Re: [PATCHv6 1/7] USB: gadget: storage_common: fixed warning building mass storage function

From: Andy Shevchenko
Date: Mon Aug 09 2010 - 06:52:45 EST


On Thu, Aug 5, 2010 at 1:27 PM, Michal Nazarewicz
<m.nazarewicz@xxxxxxxxxxx> wrote:
> The "nofua" attribute is used in the File-Storage Gadget but the
> functions handling it are defined in storage_common.c (which may be
> not a bad thing if anyone will want to port tho "nofua" attribute to
> mass storage function) which causes the following warnings:
>
> drivers/usb/gadget/storage_common.c:718: \
> Âwarning: âfsg_show_nofuaâ defined but not used
> drivers/usb/gadget/storage_common.c:782: \
> Âwarning: âfsg_store_nofuaâ defined but not used
>
> Adding __maybe_unused fixes this issue.
>
> Signed-off-by: Michal Nazarewicz <m.nazarewicz@xxxxxxxxxxx>
> Cc: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> ---
> Âdrivers/usb/gadget/storage_common.c | Â 10 +++++-----
> Â1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/usb/gadget/storage_common.c b/drivers/usb/gadget/storage_common.c
> index 484acfb..3379cc3 100644
> --- a/drivers/usb/gadget/storage_common.c
> +++ b/drivers/usb/gadget/storage_common.c
> @@ -715,8 +715,8 @@ static ssize_t fsg_show_ro(struct device *dev, struct device_attribute *attr,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â: curlun->initially_ro);
> Â}
>
> -static ssize_t fsg_show_nofua(struct device *dev, struct device_attribute *attr,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â char *buf)
> +static ssize_t __maybe_unused
> +fsg_show_nofua(struct device *dev, struct device_attribute *attr, char *buf)
> Â{
> Â Â Â Âstruct fsg_lun Â*curlun = fsg_lun_from_dev(dev);
>
> @@ -779,9 +779,9 @@ static ssize_t fsg_store_ro(struct device *dev, struct device_attribute *attr,
> Â Â Â Âreturn rc;
> Â}
>
> -static ssize_t fsg_store_nofua(struct device *dev,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âstruct device_attribute *attr,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âconst char *buf, size_t count)
> +static ssize_t __maybe_unused
> +fsg_store_nofua(struct device *dev, struct device_attribute *attr,
> + Â Â Â Â Â Â Â const char *buf, size_t count)
> Â{
> Â Â Â Âstruct fsg_lun Â*curlun = fsg_lun_from_dev(dev);
>    Âunsigned long  nofua;
> --
> 1.7.1
>
>

Acked-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>

--
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/