public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <rdreier@cisco.com>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] bsg: Fix warning with CONFIG_BLK_DEV_BSG=n
Date: Sat, 28 Jul 2007 20:49:14 -0700	[thread overview]
Message-ID: <ada6443vphh.fsf@cisco.com> (raw)

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__ */

             reply	other threads:[~2007-07-29  3:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-29  3:49 Roland Dreier [this message]
2007-07-29 10:54 ` [PATCH] bsg: Fix warning with CONFIG_BLK_DEV_BSG=n Jens Axboe
2007-07-29 13:50   ` Roland Dreier

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=ada6443vphh.fsf@cisco.com \
    --to=rdreier@cisco.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@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