public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <l.majewski@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/4] gadget: f_mass_storge: fix compilation error for MIPS.
Date: Mon, 07 Mar 2016 15:33:30 +0100	[thread overview]
Message-ID: <20160307153330.519e1a9c@amdc2363> (raw)
In-Reply-To: <1457356777-4350-2-git-send-email-purna.mandal@microchip.com>

Hi Purna,

> Compiling USB mass storage gadget for MIPS reports redefinition error.
> ------------------
> drivers/usb/gadget/f_mass_storage.c:286:13: error: redefinition of
> 'set_bit' inline void set_bit(int nr, volatile void *addr)
>              ^
> In file included from include/linux/bitops.h:123:0,
>                  from include/common.h:20,
>                  from drivers/usb/gadget/f_mass_storage.c:245:
> ./arch/mips/include/asm/bitops.h:328:24: note: previous definition of
> 'set_bit' was here static __inline__ void set_bit(int nr, volatile
> void * addr) ^
> drivers/usb/gadget/f_mass_storage.c:296:13: error: redefinition of
> 'clear_bit' inline void clear_bit(int nr, volatile void *addr)
>              ^
> In file included from include/linux/bitops.h:123:0,
>                  from include/common.h:20,
>                  from drivers/usb/gadget/f_mass_storage.c:245:
> ./arch/mips/include/asm/bitops.h:370:24: note: previous definition of
> 'clear_bit' was here static __inline__ void clear_bit(int nr,
> volatile void * addr) -------------
> Fixed it by allowing default implementation of set_bit(), clear_bit()
> for non MIPS.

I seems like MIPS (and few other architectures) is providing
implementation for {set|clear}_bit.

For ARM, those are declared as externs
at ./arch/arm/include/asm/bitops.h

I wonder why it is like that ...

Nonetheless, since I do not know how to fix this issue on ARM:

Acked-by: Lukasz Majewski <l.majewski@samsung.com>

> 
> Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
> ---
> 
> Changes in v2: None
> 
>  drivers/usb/gadget/f_mass_storage.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/gadget/f_mass_storage.c
> b/drivers/usb/gadget/f_mass_storage.c index 1ecb92a..8ca02f2 100644
> --- a/drivers/usb/gadget/f_mass_storage.c
> +++ b/drivers/usb/gadget/f_mass_storage.c
> @@ -283,6 +283,7 @@ static const char fsg_string_interface[] = "Mass
> Storage"; struct kref {int x; };
>  struct completion {int x; };
>  
> +#if !defined(CONFIG_MIPS)
>  inline void set_bit(int nr, volatile void *addr)
>  {
>  	int	mask;
> @@ -302,6 +303,7 @@ inline void clear_bit(int nr, volatile void *addr)
>  	mask = 1 << (nr & 0x1f);
>  	*a &= ~mask;
>  }
> +#endif
>  
>  struct fsg_dev;
>  struct fsg_common;



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

  reply	other threads:[~2016-03-07 14:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07 13:19 [U-Boot] [PATCH v2 1/4] drivers: musb-new: fix compilation error for MIPS Purna Chandra Mandal
2016-03-07 13:19 ` [U-Boot] [PATCH v2 2/4] gadget: f_mass_storge: " Purna Chandra Mandal
2016-03-07 14:33   ` Lukasz Majewski [this message]
2016-03-07 15:40     ` Daniel Schwierzeck
2016-03-07 13:19 ` [U-Boot] [PATCH v2 3/4] drivers: musb-new: Add USB DRC driver for Microchip PIC32 OTG controller Purna Chandra Mandal
2016-03-07 13:19 ` [U-Boot] [PATCH v2 4/4] board: pic32mzda: enable USB-host, USB-storage support Purna Chandra Mandal
2016-03-07 15:48 ` [U-Boot] [PATCH v2 1/4] drivers: musb-new: fix compilation error for MIPS Daniel Schwierzeck
2016-03-10 11:34   ` Purna Chandra Mandal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160307153330.519e1a9c@amdc2363 \
    --to=l.majewski@samsung.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox