From: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
To: Pavel Machek <pavel@denx.de>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
kernel list <linux-kernel@vger.kernel.org>,
"trivial@kernel.org" <trivial@kernel.org>
Subject: Re: [PATCH] sr: dwc2/gadget: remove unneccessary if
Date: Sat, 6 Jun 2020 15:45:14 +0000 [thread overview]
Message-ID: <4057a9d1-2cf4-78a1-9f29-587a87b523b4@synopsys.com> (raw)
In-Reply-To: <20200606153703.GA18931@amd>
Hi Pavel,
On 6/6/2020 7:37 PM, Pavel Machek wrote:
> We don't really need if/else to set variable to 1/0.
>
> Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>
>
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index 12b98b466287..f9f6fd470c81 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -1761,10 +1761,7 @@ static int dwc2_hsotg_process_req_feature(struct dwc2_hsotg *hsotg,
> case USB_RECIP_DEVICE:
> switch (wValue) {
> case USB_DEVICE_REMOTE_WAKEUP:
> - if (set)
> - hsotg->remote_wakeup_allowed = 1;
> - else
> - hsotg->remote_wakeup_allowed = 0;
> + hsotg->remote_wakeup_allowed = set;
> break;
>
> case USB_DEVICE_TEST_MODE:
>
It's good catch, but 'set' declared as 'bool' while
'remote_wakeup_allowed' is 'unsigned int'. Maybe update 'set' type to same.
Thanks,
Minas
next prev parent reply other threads:[~2020-06-06 15:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-06 15:37 Pavel Machek
2020-06-06 15:45 ` Minas Harutyunyan [this message]
2020-06-06 19:05 ` Pavel Machek
2020-06-09 8:35 ` Minas Harutyunyan
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=4057a9d1-2cf4-78a1-9f29-587a87b523b4@synopsys.com \
--to=minas.harutyunyan@synopsys.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pavel@denx.de \
--cc=trivial@kernel.org \
/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®