public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bsg: Fix warning with CONFIG_BLK_DEV_BSG=n
@ 2007-07-29  3:49 Roland Dreier
  2007-07-29 10:54 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Roland Dreier @ 2007-07-29  3:49 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel

The current stub definitions of bsg_register_queue() and
bsg_unregister_queue() as macros leads to

    drivers/scsi/scsi_sysfs.c: In function 'scsi_sysfs_add_sdev':
    drivers/scsi/scsi_sysfs.c:718: warning: unused variable 'rq'

because the first parameter of bsg_register_queue() is completely
discarded.  As akpm says, "program in C, not in cpp."  We might as
well get a little bit better type-checking when we fix this by
converting the stubs to empty inline functions.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
---
 include/linux/bsg.h |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/linux/bsg.h b/include/linux/bsg.h
index f415f89..69e23e1 100644
--- a/include/linux/bsg.h
+++ b/include/linux/bsg.h
@@ -60,8 +60,13 @@ struct bsg_class_device {
 extern int bsg_register_queue(struct request_queue *, struct device *, const char *);
 extern void bsg_unregister_queue(struct request_queue *);
 #else
-#define bsg_register_queue(disk, dev, name)		(0)
-#define bsg_unregister_queue(disk)	do { } while (0)
+static inline int bsg_register_queue(struct request_queue *q, struct device *gdev,
+				     const char *name)
+{
+	return 0;
+}
+
+static inline void bsg_unregister_queue(struct request_queue *q) { }
 #endif
 
 #endif /* __KERNEL__ */

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-07-29 13:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-29  3:49 [PATCH] bsg: Fix warning with CONFIG_BLK_DEV_BSG=n Roland Dreier
2007-07-29 10:54 ` Jens Axboe
2007-07-29 13:50   ` Roland Dreier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox