Skip to content

Commit

Permalink
usb: gadget: storage_common: Make fsg_lun_is_open() a function.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michal Nazarewicz authored and Felipe Balbi committed Nov 8, 2012
1 parent 8575f7a commit fea20db
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/usb/gadget/storage_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit fea20db

Please sign in to comment.