]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
usb: gadget: storage_common: Make fsg_lun_is_open() a function.
authorMichal Nazarewicz <mina86@mina86.com>
Tue, 6 Nov 2012 21:52:39 +0000 (22:52 +0100)
committerFelipe Balbi <balbi@ti.com>
Thu, 8 Nov 2012 14:04:04 +0000 (16:04 +0200)
Since function-line macros are to be avoided, this commit replaces
the fsg_lun_is_open() macro with a static inline function.

While at it, this commit also adds “inline” modifier to the
fsg_lun_from_dev() function.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/storage_common.c

index 1b5bc6969a0a5c123c3547ca216eaccb2a1a0d2f..0e3ae43454a246543317d323eb07667ae1693ea1 100644 (file)
@@ -155,9 +155,12 @@ struct fsg_lun {
        struct device   dev;
 };
 
-#define fsg_lun_is_open(curlun)        ((curlun)->filp != NULL)
+static inline bool fsg_lun_is_open(struct fsg_lun *curlun)
+{
+       return curlun->filp != NULL;
+}
 
-static struct fsg_lun *fsg_lun_from_dev(struct device *dev)
+static inline struct fsg_lun *fsg_lun_from_dev(struct device *dev)
 {
        return container_of(dev, struct fsg_lun, dev);
 }