Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

authored by

Michal Nazarewicz and committed by
Felipe Balbi
fea20dbc 8575f7a7

+5 -2
+5 -2
drivers/usb/gadget/storage_common.c
··· 155 155 struct device dev; 156 156 }; 157 157 158 - #define fsg_lun_is_open(curlun) ((curlun)->filp != NULL) 158 + static inline bool fsg_lun_is_open(struct fsg_lun *curlun) 159 + { 160 + return curlun->filp != NULL; 161 + } 159 162 160 - static struct fsg_lun *fsg_lun_from_dev(struct device *dev) 163 + static inline struct fsg_lun *fsg_lun_from_dev(struct device *dev) 161 164 { 162 165 return container_of(dev, struct fsg_lun, dev); 163 166 }