All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] drivers, usb, gadget: fix compiler warnings for at91_udc.c
Date: Fri, 23 Jun 2017 15:31:35 +0200	[thread overview]
Message-ID: <594D1837.2020305@denx.de> (raw)
In-Reply-To: <20170623145004.42b91e3f@jawa>

Hello Lukasz,

Am 23.06.2017 um 14:50 schrieb Lukasz Majewski:
> Hi Heiko,
>
>> fix warnings:
>> drivers/usb/gadget/at91_udc.c:1344:12: warning: 'at91rm9200_udc_init'
>> defined but not used [-Wunused-function]
>> drivers/usb/gadget/at91_udc.c:1379:13: warning:
>> 'at91rm9200_udc_pullup' defined but not used [-Wunused-function]
>> drivers/usb/gadget/at91_udc.c:1476:12: warning:
>> 'at91sam9263_udc_init' defined but not used [-Wunused-function]
>>
>> Signed-off-by: Heiko Schocher <hs@denx.de>
>> ---
>>
>>   drivers/usb/gadget/at91_udc.c | 30 +++---------------------------
>>   1 file changed, 3 insertions(+), 27 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/at91_udc.c
>> b/drivers/usb/gadget/at91_udc.c index 01a5907..85bfbf5 100644
>> --- a/drivers/usb/gadget/at91_udc.c
>> +++ b/drivers/usb/gadget/at91_udc.c
>> @@ -1341,7 +1341,7 @@ static int at91_stop(struct usb_gadget *gadget)
>>
>>   /*-------------------------------------------------------------------------*/
>>
>> -static int at91rm9200_udc_init(struct at91_udc *udc)
>> +static __maybe_unused int at91rm9200_udc_init(struct at91_udc *udc)
>>   {
>>   	struct at91_ep *ep;
>>   	int ret;
>> @@ -1376,7 +1376,8 @@ static int at91rm9200_udc_init(struct at91_udc
>> *udc) return 0;
>>   }
>>
>> -static void at91rm9200_udc_pullup(struct at91_udc *udc, int is_on)
>> +static __maybe_unused
>> +void at91rm9200_udc_pullup(struct at91_udc *udc, int is_on)
>>   {
>>   	int active = !udc->board.pullup_active_low;
>>
>> @@ -1473,31 +1474,6 @@ static const struct at91_udc_caps
>> at91sam9261_udc_caps = { };
>>   #endif
>>
>> -static int at91sam9263_udc_init(struct at91_udc *udc)
>
> I'm a bit puzzled...
>
> For the at91rm9200 related boards it is enough to add __maybe_unused
> and leave the unused function in the source code.
>
> Hence, I'm wondering why do you remove the function for at91sam9263?
>
> Shouldn't all be removed or have added __maybe_unused ?

Hmm.. No, it seems there are no users for the at91sam9263_udc_init()

pollux:u-boot hs [master] $ grep -lr at91sam9263_udc_init .
./drivers/usb/gadget/at91_udc.c
pollux:u-boot hs [master] $

And in ./drivers/usb/gadget/at91_udc.c it is only defined, but not used...

bye,
Heiko
>
>> -{
>> -	struct at91_ep *ep;
>> -	int i;
>> -
>> -	for (i = 0; i < NUM_ENDPOINTS; i++) {
>> -		ep = &udc->ep[i];
>> -
>> -		switch (i) {
>> -		case 0:
>> -		case 1:
>> -		case 2:
>> -		case 3:
>> -			ep->maxpacket = 64;
>> -			break;
>> -		case 4:
>> -		case 5:
>> -			ep->maxpacket = 256;
>> -			break;
>> -		}
>> -	}
>> -
>> -	return 0;
>> -}
>> -
>>   int usb_gadget_handle_interrupts(int index)
>>   {
>>   	struct at91_udc *udc = controller;
>
>
>
>
> Best regards,
>
> Lukasz Majewski
>
> --
>
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
>

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2017-06-23 13:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-22  6:49 [U-Boot] [PATCH 0/2] at91: fix smartweb board support Heiko Schocher
2017-06-22  6:49 ` [U-Boot] [PATCH 1/2] drivers, usb, gadget: fix compiler warnings for at91_udc.c Heiko Schocher
2017-06-23 12:50   ` Lukasz Majewski
2017-06-23 13:31     ` Heiko Schocher [this message]
2017-06-23 13:49       ` Tom Rini
2017-06-23 14:05       ` Lukasz Majewski
2017-06-22  6:49 ` [U-Boot] [PATCH 2/2] atmel, at91: fix smartweb board Heiko Schocher
2017-07-06  4:49   ` Simon Glass

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=594D1837.2020305@denx.de \
    --to=hs@denx.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.