lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 28 Jul 2007 20:49:14 -0700
From:	Roland Dreier <rdreier@...co.com>
To:	Jens Axboe <jens.axboe@...cle.com>
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] bsg: Fix warning with CONFIG_BLK_DEV_BSG=n

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@...co.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__ */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ