From: Michal Nazarewicz Date: Tue, 6 Nov 2012 21:52:39 +0000 (+0100) Subject: usb: gadget: storage_common: Make fsg_lun_is_open() a function. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fea20dbcfd6673d73d510984589897bd921c8a1d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git usb: gadget: storage_common: Make fsg_lun_is_open() a function. 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 Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/storage_common.c b/drivers/usb/gadget/storage_common.c index 1b5bc6969a0a..0e3ae43454a2 100644 --- a/drivers/usb/gadget/storage_common.c +++ b/drivers/usb/gadget/storage_common.c @@ -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); }