Skip to contentSkip to conversation

fix compile warning with version string in sg.c

PATCH New Muli Ben-Yehuda 1 participant 1 message Sep 21, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix compile warning with version string in sg.c

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'.

drivers/scsi/sg.c renamed from linux-2.5/drivers/scsi/sg.c +5 -1
diff --exclude-from /home/muli/p/dontdiff -Naur ../linux-2.5/drivers/scsi/sg.c 2.6.0-t5-Werror/drivers/scsi/sg.c
@@ -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 ([email protected], [email protected]), notes:
Signature · 2 lines
Muli Ben-Yehuda
http://www.mulix.org