From: Muli Ben-Yehuda <mulix@mulix.org>
To: Doug Gilbert <dgilbert@interlog.com>
Cc: linux-scsi@vger.kernel.org, Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] fix compile warning with version string in sg.c
Date: Sun, 21 Sep 2003 11:04:07 +0300 [thread overview]
Message-ID: <20030921080406.GB4938@actcom.co.il> (raw)
[-- Attachment #1: Type: text/plain, Size: 992 bytes --]
When compiling without CONFIG_SCSI_PROC_FS, I get a warning:
drivers/scsi/sg.c:21: warning: `sg_version_str' defined but not used
This patch fixes it, by definining sg_version_str only if
CONFIG_SCSI_PROC_FS is set. It also turns sg_version_str from char* to
char[], to move it from 'data' to 'rodata'.
diff --exclude-from /home/muli/p/dontdiff -Naur ../linux-2.5/drivers/scsi/sg.c 2.6.0-t5-Werror/drivers/scsi/sg.c
--- ../linux-2.5/drivers/scsi/sg.c Sat Sep 6 00:19:59 2003
+++ 2.6.0-t5-Werror/drivers/scsi/sg.c Sun Sep 21 10:29:43 2003
@@ -18,7 +18,11 @@
*
*/
#include <linux/config.h>
-static char *sg_version_str = "3.5.29 [20030529]";
+
+#ifdef CONFIG_SCSI_PROC_FS
+const static char sg_version_str[] = "3.5.29 [20030529]";
+#endif /* CONFIG_SCSI_PROC_FS */
+
static int sg_version_num = 30529; /* 2 digits for each component */
/*
* D. P. Gilbert (dgilbert@interlog.com, dougg@triode.net.au), notes:
--
Muli Ben-Yehuda
http://www.mulix.org
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
reply other threads:[~2003-09-21 8:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030921080406.GB4938@actcom.co.il \
--to=mulix@mulix.org \
--cc=dgilbert@interlog.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®