Skip to contentSkip to conversation

scsi_device_put unused variable module without CONFIG_MODULE_UNLOAD

PATCH In review Andy Whitcroft 2 participants 2 messages Nov 22, 2006 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi_device_put unused variable module without CONFIG_MODULE_UNLOAD

scsi_device_put: unused variable module without CONFIG_MODULE_UNLOAD

When CONFIG_MODULE_UNLOAD is not defined then the module variable in scsi_device_put() becomes unused resulting in the warnings below. Move this inside the existing #ifdef.

.../drivers/scsi/scsi.c:883: warning: unused variable 'module'

Against 2.6.19-rc5-mm2.

---

drivers/scsi/scsi.c +1 -1
index 680d72e..fafc00d 100644
@@ -880,9 +880,9 @@ EXPORT_SYMBOL(scsi_device_get);
  */
 void scsi_device_put(struct scsi_device *sdev)
 {
+#ifdef CONFIG_MODULE_UNLOAD
 	struct module *module = sdev->host->hostt->module;
 
-#ifdef CONFIG_MODULE_UNLOAD
 	/* The module refcount will be zero if scsi_device_get()
 	 * was called from a module removal routine */
 	if (module && module_refcount(module) != 0)
#1 lore raw
Quoted 7 lines · Andy Whitcroft

scsi_device_put: unused variable module without CONFIG_MODULE_UNLOAD

When CONFIG_MODULE_UNLOAD is not defined then the module variable in scsi_device_put() becomes unused resulting in the warnings below. Move this inside the existing #ifdef.

.../drivers/scsi/scsi.c:883: warning: unused variable 'module'

Actually, the fix for this is already in scsi-misc, so it should be making its way into -mm.

James