mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix compile warning with version string in sg.c
@ 2003-09-21  8:04 Muli Ben-Yehuda
  0 siblings, 0 replies; only message in thread
From: Muli Ben-Yehuda @ 2003-09-21  8:04 UTC (permalink / raw)
  To: Doug Gilbert; +Cc: linux-scsi, Linux-Kernel

[-- 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 --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-09-21  8:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-21  8:04 [PATCH] fix compile warning with version string in sg.c Muli Ben-Yehuda

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®