From: <vl...@us...> - 2008-05-23 15:22:14
|
Revision: 393 http://scst.svn.sourceforge.net/scst/?rev=393&view=rev Author: vlnb Date: 2008-05-23 08:22:12 -0700 (Fri, 23 May 2008) Log Message: ----------- Patch from Bart Van Assche <bar...@gm...>: The patch below fixes the following checkpatch warning: __func__ should be used instead of gcc specific __FUNCTION__ This patch has been tested as follows: - Checked that make iscsi scst still works. - Checked that after loading the scst module the kernel messages generated because of the shell command "echo all >/proc/scsi_tg/trace_level" still make sense. An example: [ 646.408035] [5845]: scst: scst_proc_log_entry_write:346:Changed trace level for "scsi_tgt": old 0x80005f0e, new 0xffffffff - Checked that the patch generated by generate-kernel-patch still applies cleanly to the 2.6.25.4 kernel, that the patched kernel still compiles, installs and boots and that the scst, iscsi-scst and ib_srpt modules still load (I performed rm -rf /lib/modules/2.6.25.4* before starting kernel compilation). Signed-off-by: Bart Van Assche <bar...@gm...> Modified Paths: -------------- trunk/iscsi-scst/kernel/digest.c trunk/iscsi-scst/usr/iscsi_adm.c trunk/iscsi-scst/usr/iscsid.c trunk/iscsi-scst/usr/isns.c trunk/iscsi-scst/usr/target.c trunk/scst/include/scst_debug.h trunk/scst/src/scst_lib.c trunk/scst/src/scst_main.c Modified: trunk/iscsi-scst/kernel/digest.c =================================================================== --- trunk/iscsi-scst/kernel/digest.c 2008-05-23 15:19:52 UTC (rev 392) +++ trunk/iscsi-scst/kernel/digest.c 2008-05-23 15:22:12 UTC (rev 393) @@ -195,7 +195,7 @@ u32 offset; TRACE_DBG("%s:%d req %p, own_sg %d, sg %p, sgcnt %d cmnd %p, " - "own_sg %d, sg %p, sgcnt %d", __FUNCTION__, __LINE__, + "own_sg %d, sg %p, sgcnt %d", __func__, __LINE__, cmnd->parent_req, cmnd->parent_req->own_sg, cmnd->parent_req->sg, cmnd->parent_req->sg_cnt, cmnd, cmnd->own_sg, cmnd->sg, cmnd->sg_cnt); Modified: trunk/iscsi-scst/usr/iscsi_adm.c =================================================================== --- trunk/iscsi-scst/usr/iscsi_adm.c 2008-05-23 15:19:52 UTC (rev 392) +++ trunk/iscsi-scst/usr/iscsi_adm.c 2008-05-23 15:22:12 UTC (rev 393) @@ -137,7 +137,7 @@ if (ret != sizeof(*req)) { err = (ret < 0) ? -errno : -EIO; - fprintf(stderr, "%s %d %d %d\n", __FUNCTION__, __LINE__, ret, + fprintf(stderr, "%s %d %d %d\n", __func__, __LINE__, ret, err); } else err = 0; @@ -162,7 +162,7 @@ if (ret != sizeof(rsp) + sizeof(*req)) { err = (ret < 0) ? -errno : -EIO; - fprintf(stderr, "%s %d %d %d\n", __FUNCTION__, __LINE__, ret, + fprintf(stderr, "%s %d %d %d\n", __func__, __LINE__, ret, err); } else err = rsp.err; Modified: trunk/iscsi-scst/usr/iscsid.c =================================================================== --- trunk/iscsi-scst/usr/iscsid.c 2008-05-23 15:19:52 UTC (rev 392) +++ trunk/iscsi-scst/usr/iscsid.c 2008-05-23 15:22:12 UTC (rev 393) @@ -642,7 +642,7 @@ if (ss.ss_family == AF_INET6 && suppress_ip6) { if (strstr(p, "::ffff:") != p) { log_error("%s, %s:%d.", __FILE__, - __FUNCTION__, __LINE__); + __func__, __LINE__); suppress_ip6 = 0; } else addr += 7; Modified: trunk/iscsi-scst/usr/isns.c =================================================================== --- trunk/iscsi-scst/usr/isns.c 2008-05-23 15:19:52 UTC (rev 392) +++ trunk/iscsi-scst/usr/isns.c 2008-05-23 15:22:12 UTC (rev 393) @@ -141,7 +141,7 @@ return -1; } - log_error("%s %d: new connection %d", __FUNCTION__, __LINE__, fd); + log_error("%s %d: new connection %d", __func__, __LINE__, fd); if (!strlen(eid)) { err = isns_get_ip(fd); @@ -210,7 +210,7 @@ err = write(isns_fd, buf, length + sizeof(struct isns_hdr)); if (err < 0) - log_error("%s %d: %s", __FUNCTION__, __LINE__, strerror(errno)); + log_error("%s %d: %s", __func__, __LINE__, strerror(errno)); return 0; } @@ -269,7 +269,7 @@ err = write(isns_fd, buf, length + sizeof(struct isns_hdr)); if (err < 0) - log_error("%s %d: %s", __FUNCTION__, __LINE__, strerror(errno)); + log_error("%s %d: %s", __func__, __LINE__, strerror(errno)); return 0; } @@ -323,7 +323,7 @@ err = write(isns_fd, buf, length + sizeof(struct isns_hdr)); if (err < 0) - log_error("%s %d: %s", __FUNCTION__, __LINE__, strerror(errno)); + log_error("%s %d: %s", __func__, __LINE__, strerror(errno)); return 0; } @@ -361,7 +361,7 @@ err = write(isns_fd, buf, length + sizeof(struct isns_hdr)); if (err < 0) - log_error("%s %d: %s", __FUNCTION__, __LINE__, strerror(errno)); + log_error("%s %d: %s", __func__, __LINE__, strerror(errno)); return 0; } @@ -423,7 +423,7 @@ err = write(isns_fd, buf, length + sizeof(struct isns_hdr)); if (err < 0) - log_error("%s %d: %s", __FUNCTION__, __LINE__, strerror(errno)); + log_error("%s %d: %s", __func__, __LINE__, strerror(errno)); if (scn_listen_port) isns_scn_register(); @@ -493,7 +493,7 @@ err = write(isns_fd, buf, length + sizeof(struct isns_hdr)); if (err < 0) - log_error("%s %d: %s", __FUNCTION__, __LINE__, strerror(errno)); + log_error("%s %d: %s", __func__, __LINE__, strerror(errno)); return 0; } @@ -587,7 +587,7 @@ get_hdr_param(hdr, function, length, flags, transaction, \ sequence) \ log_error("%s %d: unknown function %x %u %x %u %u", \ - __FUNCTION__, __LINE__, \ + __func__, __LINE__, \ function, length, flags, transaction, sequence); \ } @@ -644,28 +644,28 @@ } log_error("%s %d: transaction not found %u", - __FUNCTION__, __LINE__, transaction); + __func__, __LINE__, transaction); return; found: if (status) { log_error("%s %d: error response %u", - __FUNCTION__, __LINE__, status); + __func__, __LINE__, status); goto free_qry_mgmt; } if (!strlen(mgmt->name)) { log_debug(1, "%s %d: skip %u", - __FUNCTION__, __LINE__, transaction); + __func__, __LINE__, transaction); goto free_qry_mgmt; } target = target_lookup_by_name(mgmt->name); if (!target) { log_error("%s %d: invalid tid %s", - __FUNCTION__, __LINE__, mgmt->name); + __func__, __LINE__, mgmt->name); goto free_qry_mgmt; } @@ -684,7 +684,7 @@ break; case ISNS_ATTR_ISCSI_NODE_TYPE: if (ntohl(*(tlv->value)) == ISNS_NODE_INITIATOR && name) { - log_error("%s %d: %s", __FUNCTION__, __LINE__, + log_error("%s %d: %s", __func__, __LINE__, (char *) name); ini = malloc(sizeof(*ini)); if (!ini) @@ -723,7 +723,7 @@ if (err) { if (err == -EAGAIN) return err; - log_debug(1, "%s %d: close connection %d", __FUNCTION__, __LINE__, + log_debug(1, "%s %d: close connection %d", __func__, __LINE__, isns_fd); close(isns_fd); isns_fd = 0; @@ -746,7 +746,7 @@ case ISNS_FUNC_SCN: name = print_scn_pdu(hdr); if (name) { - log_error("%s %d: %s", __FUNCTION__, __LINE__, name); + log_error("%s %d: %s", __func__, __LINE__, name); isns_attr_query(name); } break; @@ -766,7 +766,7 @@ slen = sizeof(from); fd = accept(scn_listen_fd, (struct sockaddr *) &from, &slen); if (fd < 0) { - log_error("%s %d: accept error %s", __FUNCTION__, __LINE__, + log_error("%s %d: accept error %s", __func__, __LINE__, strerror(errno)); return -errno; } @@ -774,7 +774,7 @@ err = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt)); if (err) - log_error("%s %d: %s\n", __FUNCTION__, __LINE__, + log_error("%s %d: %s\n", __func__, __LINE__, strerror(errno)); /* not critical, so ignore. */ @@ -804,7 +804,7 @@ err = write(scn_fd, buf, length + sizeof(struct isns_hdr)); if (err < 0) - log_error("%s %d: %s", __FUNCTION__, __LINE__, strerror(errno)); + log_error("%s %d: %s", __func__, __LINE__, strerror(errno)); } int isns_scn_handle(int is_accept) @@ -815,7 +815,7 @@ uint16_t function, length, flags, transaction, sequence; char *name = NULL; - log_error("%s %d: %d", __FUNCTION__, __LINE__, is_accept); + log_error("%s %d: %d", __func__, __LINE__, is_accept); if (is_accept) return scn_accept_connection(); @@ -824,7 +824,7 @@ if (err) { if (err == -EAGAIN) return err; - log_debug(1, "%s %d: close connection %d", __FUNCTION__, __LINE__, + log_debug(1, "%s %d: close connection %d", __func__, __LINE__, scn_fd); close(scn_fd); scn_fd = 0; @@ -858,7 +858,7 @@ fd = socket(ss.ss_family, SOCK_STREAM, IPPROTO_TCP); if (fd < 0) { - log_error("%s %d: %s\n", __FUNCTION__, __LINE__, strerror(errno)); + log_error("%s %d: %s\n", __func__, __LINE__, strerror(errno)); return -errno; } @@ -866,21 +866,21 @@ if (ss.ss_family == AF_INET6) { err = setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &opt, sizeof(opt)); if (err) - log_error("%s %d: %s\n", __FUNCTION__, __LINE__, + log_error("%s %d: %s\n", __func__, __LINE__, strerror(errno)); goto out; } err = listen(fd, 5); if (err) { - log_error("%s %d: %s\n", __FUNCTION__, __LINE__, strerror(errno)); + log_error("%s %d: %s\n", __func__, __LINE__, strerror(errno)); goto out; } slen = sizeof(lss); err = getsockname(fd, (struct sockaddr *) &lss, &slen); if (err) { - log_error("%s %d: %s\n", __FUNCTION__, __LINE__, strerror(errno)); + log_error("%s %d: %s\n", __func__, __LINE__, strerror(errno)); goto out; } Modified: trunk/iscsi-scst/usr/target.c =================================================================== --- trunk/iscsi-scst/usr/target.c 2008-05-23 15:19:52 UTC (rev 392) +++ trunk/iscsi-scst/usr/target.c 2008-05-23 15:22:12 UTC (rev 393) @@ -96,7 +96,7 @@ remque(&target->tlist); if (!list_empty(&target->sessions_list)) { - log_error("%s still have sessions %d\n", __FUNCTION__, tid); + log_error("%s still have sessions %d\n", __func__, tid); exit(-1); } Modified: trunk/scst/include/scst_debug.h =================================================================== --- trunk/scst/include/scst_debug.h 2008-05-23 15:19:52 UTC (rev 392) +++ trunk/scst/include/scst_debug.h 2008-05-23 15:22:12 UTC (rev 393) @@ -151,7 +151,7 @@ if (___unlikely(trace_flag & (trace))) { \ char *__tflag = LOG_FLAG; \ if (debug_print_prefix(trace_flag, __tflag, __LOG_PREFIX, \ - __FUNCTION__, __LINE__) > 0) { \ + __func__, __LINE__) > 0) { \ __tflag = NO_FLAG; \ } \ PRINT(NO_FLAG, "%s" format, __tflag, args); \ @@ -168,7 +168,7 @@ do { \ if (___unlikely(trace_flag & (flag))) { \ char *__tflag = INFO_FLAG; \ - if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__,\ + if (debug_print_prefix(trace_flag, __tflag, NULL, __func__,\ __LINE__) > 0) { \ __tflag = NO_FLAG; \ } \ @@ -191,7 +191,7 @@ do { \ if (trace_flag & (trace)) { \ char *__tflag = LOG_FLAG; \ - if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__,\ + if (debug_print_prefix(trace_flag, __tflag, NULL, __func__,\ __LINE__) > 0) { \ __tflag = NO_FLAG; \ } \ @@ -210,7 +210,7 @@ do { \ if (trace_flag & TRACE_BUFF) { \ char *__tflag = LOG_FLAG; \ - if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__, \ + if (debug_print_prefix(trace_flag, __tflag, NULL, __func__, \ __LINE__) > 0) { \ __tflag = NO_FLAG; \ } \ @@ -223,7 +223,7 @@ do { \ if (trace_flag & (flag)) { \ char *__tflag = LOG_FLAG; \ - if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__, \ + if (debug_print_prefix(trace_flag, __tflag, NULL, __func__, \ __LINE__) > 0) { \ __tflag = NO_FLAG; \ } \ @@ -236,7 +236,7 @@ do { \ char *__tflag = log_flag; \ if (debug_print_prefix(trace_flag, __tflag, __LOG_PREFIX, \ - __FUNCTION__, __LINE__) > 0) { \ + __func__, __LINE__) > 0) { \ __tflag = NO_FLAG; \ } \ PRINT(NO_FLAG, "%s" format, __tflag, args); \ @@ -272,10 +272,10 @@ if (trace_flag & TRACE_ENTRYEXIT) { \ if (trace_flag & TRACE_PID) { \ PRINT(LOG_FLAG, "[%d]: ENTRY %s", current->pid, \ - __FUNCTION__); \ + __func__); \ } \ else { \ - PRINT(LOG_FLAG, "ENTRY %s", __FUNCTION__); \ + PRINT(LOG_FLAG, "ENTRY %s", __func__); \ } \ } \ } while (0) @@ -285,10 +285,10 @@ if (trace_flag & TRACE_ENTRYEXIT) { \ if (trace_flag & TRACE_PID) { \ PRINT(LOG_FLAG, "[%d]: EXIT %s", current->pid, \ - __FUNCTION__); \ + __func__); \ } \ else { \ - PRINT(LOG_FLAG, "EXIT %s", __FUNCTION__); \ + PRINT(LOG_FLAG, "EXIT %s", __func__); \ } \ } \ } while (0) @@ -298,10 +298,10 @@ if (trace_flag & TRACE_ENTRYEXIT) { \ if (trace_flag & TRACE_PID) { \ PRINT(LOG_FLAG, "[%d]: EXIT %s: %ld", current->pid, \ - __FUNCTION__, (long)(res)); \ + __func__, (long)(res)); \ } \ else { \ - PRINT(LOG_FLAG, "EXIT %s: %ld", __FUNCTION__, (long)(res)); \ + PRINT(LOG_FLAG, "EXIT %s: %ld", __func__, (long)(res)); \ } \ } \ } while (0) @@ -311,10 +311,10 @@ if (trace_flag & TRACE_ENTRYEXIT) { \ if (trace_flag & TRACE_PID) { \ PRINT(LOG_FLAG, "[%d]: EXIT %s: 0x%lx", current->pid, \ - __FUNCTION__, (long)(res)); \ + __func__, (long)(res)); \ } \ else { \ - PRINT(LOG_FLAG, "EXIT %s: %lx", __FUNCTION__, (long)(res)); \ + PRINT(LOG_FLAG, "EXIT %s: %lx", __func__, (long)(res)); \ } \ } \ } while (0) Modified: trunk/scst/src/scst_lib.c =================================================================== --- trunk/scst/src/scst_lib.c 2008-05-23 15:19:52 UTC (rev 392) +++ trunk/scst/src/scst_lib.c 2008-05-23 15:22:12 UTC (rev 393) @@ -262,7 +262,7 @@ if (!list_empty(&dev->dev_tgt_dev_list) || !list_empty(&dev->dev_acg_dev_list)) { PRINT_CRIT_ERROR("%s: dev_tgt_dev_list or dev_acg_dev_list " - "is not empty!", __FUNCTION__); + "is not empty!", __func__); sBUG(); } #endif @@ -354,7 +354,7 @@ TRACE_ENTRY(); if (!list_empty(&acg->acg_sess_list)) { - PRINT_ERROR("%s: acg_sess_list is not empty!", __FUNCTION__); + PRINT_ERROR("%s: acg_sess_list is not empty!", __func__); res = -EBUSY; goto out; } @@ -1341,7 +1341,7 @@ #if defined(EXTRACHECKS) && (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)) if (cmd->scsi_req) { - PRINT_ERROR("%s: %s", __FUNCTION__, "Cmd with unfreed " + PRINT_ERROR("%s: %s", __func__, "Cmd with unfreed " "scsi_req!"); scst_release_request(cmd); } @@ -2193,7 +2193,7 @@ buffer_size = scst_get_buf_first(cmd, &buffer); if (unlikely(buffer_size <= 0)) { PRINT_ERROR("%s: Unable to get the buffer " - "(%d)", __FUNCTION__, buffer_size); + "(%d)", __func__, buffer_size); goto out; } @@ -2245,7 +2245,7 @@ buffer_size = scst_get_buf_first(cmd, &buffer); if (unlikely(buffer_size <= 0)) { PRINT_ERROR("%s: Unable to get the buffer (%d)", - __FUNCTION__, buffer_size); + __func__, buffer_size); goto out; } break; Modified: trunk/scst/src/scst_main.c =================================================================== --- trunk/scst/src/scst_main.c 2008-05-23 15:19:52 UTC (rev 392) +++ trunk/scst/src/scst_main.c 2008-05-23 15:22:12 UTC (rev 393) @@ -644,13 +644,13 @@ if (dev_handler == NULL) { PRINT_ERROR("%s: valid device handler must be supplied", - __FUNCTION__); + __func__); res = -EINVAL; goto out; } if (dev_name == NULL) { - PRINT_ERROR("%s: device name must be non-NULL", __FUNCTION__); + PRINT_ERROR("%s: device name must be non-NULL", __func__); res = -EINVAL; goto out; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |