From: Alan Stern <stern@rowland.harvard.edu>
To: Robert Greener <rob@robgreener.com>
Cc: USB mailing list <linux-usb@vger.kernel.org>
Subject: Re: [PATCH 11/13] usb: core: config: remove unnecessary parentheses
Date: Tue, 5 Oct 2021 10:41:51 -0400 [thread overview]
Message-ID: <20211005144151.GF621017@rowland.harvard.edu> (raw)
In-Reply-To: <46320ab3bcc30f51da1f1dacf24eeed082690fa2.1633442131.git.rob@robgreener.com>
On Tue, Oct 05, 2021 at 02:37:35PM +0100, Robert Greener wrote:
> This fixes the following checkpatch.pl warnings:
>
> core/config.c:657: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'header->bLength > size2'
> core/config.c:657: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'header->bLength < 2'
>
> Signed-off-by: Robert Greener <rob@robgreener.com>
> ---
> drivers/usb/core/config.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
> index 76038e8c84c5..ab3395ec4260 100644
> --- a/drivers/usb/core/config.c
> +++ b/drivers/usb/core/config.c
> @@ -267,8 +267,7 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno,
>
> if (d->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE) {
> n = USB_DT_ENDPOINT_AUDIO_SIZE;
> - }
> - else if (d->bLength >= USB_DT_ENDPOINT_SIZE) {
> + } else if (d->bLength >= USB_DT_ENDPOINT_SIZE) {
> n = USB_DT_ENDPOINT_SIZE;
> } else {
> dev_warn(ddev,
This has no connection with the patch's purpose. It looks like a
remnant from an earlier patch.
Alan Stern
> @@ -655,7 +654,7 @@ static int usb_parse_configuration(struct usb_device *dev, int cfgidx,
> }
>
> header = (struct usb_descriptor_header *)buffer2;
> - if ((header->bLength > size2) || (header->bLength < 2)) {
> + if (header->bLength > size2 || header->bLength < 2) {
> dev_warn(ddev,
> "config %d has an invalid descriptor of length %d, skipping remainder of the config\n",
> cfgno, header->bLength);
> --
> 2.32.0
>
next prev parent reply other threads:[~2021-10-05 14:41 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-05 13:55 [PATCH 00/13] usb: core: config: fix all checkpatch.pl warnings Robert Greener
2021-10-05 12:22 ` [PATCH 01/13] usb: core: config: Use tabs rather than spaces for new lines of args Robert Greener
2021-10-05 12:31 ` [PATCH 02/13] usb: core: config: fix block comment styles Robert Greener
2021-10-05 14:25 ` Alan Stern
2021-10-05 15:05 ` Robert Greener
2021-10-05 12:35 ` [PATCH 03/13] usb: core: config: Change `unsigned` to `unsigned int` Robert Greener
2021-10-05 12:37 ` [PATCH 04/13] usb: core: config: Avoid multiple line derefrence Robert Greener
2021-10-05 14:33 ` Alan Stern
2021-10-05 12:41 ` [PATCH 05/13] usb: core: config: Fix typo in dev_warn Robert Greener
2021-10-05 13:22 ` [PATCH 06/13] usb: core: config: unsplit strings which are split across lines Robert Greener
2021-10-05 13:25 ` [PATCH 07/13] usb: core: config: remove unnecessary blank lines Robert Greener
2021-10-05 13:26 ` [PATCH 08/13] usb: core: config: add blank lines after struct def Robert Greener
2021-10-05 13:30 ` [PATCH 09/13] usb: core: config: fix inline spacign Robert Greener
2021-10-05 14:32 ` Alan Stern
2021-10-05 13:34 ` [PATCH 10/13] usb: core: config: fix checkpatch.pl braces warning Robert Greener
2021-10-05 14:40 ` Alan Stern
2021-10-05 13:37 ` [PATCH 11/13] usb: core: config: remove unnecessary parentheses Robert Greener
2021-10-05 14:41 ` Alan Stern [this message]
2021-10-05 13:43 ` [PATCH 12/13] usb: core: config: remove multiple assignments Robert Greener
2021-10-05 14:44 ` Alan Stern
2021-10-05 13:52 ` [PATCH 13/13] usb: core: config: fix parenthesis alignment Robert Greener
2021-10-05 14:47 ` Alan Stern
2021-10-05 14:37 ` [PATCH 00/13] usb: core: config: fix all checkpatch.pl warnings Greg KH
2021-10-05 14:52 ` Robert Greener
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=20211005144151.GF621017@rowland.harvard.edu \
--to=stern@rowland.harvard.edu \
--cc=linux-usb@vger.kernel.org \
--cc=rob@robgreener.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