mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Tang Bin <tangbin@cmss.chinamobile.com>,
	cernekee@gmail.com, balbi@kernel.org, gregkh@linuxfoundation.org
Cc: f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com,
	linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2]usb: gadget: bcm63xx_udc:remove redundant variable assignment
Date: Tue, 24 Mar 2020 17:55:27 +0300	[thread overview]
Message-ID: <82d75ffd-0df5-d41c-7b3e-615d97c1838a@cogentembedded.com> (raw)
In-Reply-To: <a0afd44f-177d-ad21-02b5-93b15b29399e@cogentembedded.com>

On 03/24/2020 05:50 PM, Sergei Shtylyov wrote:

>> --v1------------------------------------
>> In this function, the variable 'rc' is assigned after this place,
>> so the definition is invalid.
>>
>> --v2------------------------------------
>> In this function, the variable 'rc' will be assigned by the function
>> 'usb_add_gadget_udc()',so the assignment here is redundant,we should
>> remove it.
>>
>> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
> 
>    NAK.
> 
>> ---
>>  drivers/usb/gadget/udc/bcm63xx_udc.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c
>> index 54501814d..a7afa8c35 100644
>> --- a/drivers/usb/gadget/udc/bcm63xx_udc.c
>> +++ b/drivers/usb/gadget/udc/bcm63xx_udc.c
>> @@ -2321,8 +2321,6 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
>>  	if (rc)
>>  		return rc;
>>  
>> -	rc = -ENXIO;
>> -
>>  	/* IRQ resource #0: control interrupt (VBUS, speed, etc.) */
>>  	irq = platform_get_irq(pdev, 0);
>>  	if (irq < 0)
> 
>    This *if* branch goes to the 'out_uninit' label which uses 'rc' (and it should
> be negative).
>    In principle, if you change 'rc' to 'irq' below, this patch would be sane.
> It's not as is.

   Still, the other *goto* out_uninit in te loop below shoild be changed as well.
Otherwise, if the result is overriden to -ENXIO, e.g. deferred probing is borked.

MBR, Sergei

      reply	other threads:[~2020-03-24 14:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24 13:20 Tang Bin
2020-03-24 14:50 ` Sergei Shtylyov
2020-03-24 14:55   ` Sergei Shtylyov [this message]

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=82d75ffd-0df5-d41c-7b3e-615d97c1838a@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=balbi@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=cernekee@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=tangbin@cmss.chinamobile.com \
    /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

all inboxes | Powered by JetHome®