linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Manuel Quintero F <sakunix@yahoo.com>
Cc: duncan.sands@free.fr, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB: atm: speedtch: do not use assignment in if condition
Date: Fri, 4 Oct 2024 08:20:04 +0200	[thread overview]
Message-ID: <2024100400-whiff-unspoiled-0e1a@gregkh> (raw)
In-Reply-To: <20241004030512.2036-1-sakunix@yahoo.com>

On Thu, Oct 03, 2024 at 08:05:12PM -0700, Manuel Quintero F wrote:
> Fix checkpatch error "do not use assignment in if condition"
> 
> Signed-off-by: Manuel Quintero F <sakunix@yahoo.com>
> Signed-off-by: Manuel Quintero F <sakunix@yahoo.com>

Why twice?

> ---
>  drivers/usb/atm/speedtch.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c
> index 973548b5c15c..dfd362abf602 100644
> --- a/drivers/usb/atm/speedtch.c
> +++ b/drivers/usb/atm/speedtch.c
> @@ -324,7 +324,9 @@ static int speedtch_upload_firmware(struct speedtch_instance_data *instance,
>  	   because we're in our own kernel thread anyway. */
>  	msleep_interruptible(1000);
>  
> -	if ((ret = usb_set_interface(usb_dev, INTERFACE_DATA, instance->params.altsetting)) < 0) {
> +	ret = usb_set_interface(usb_dev, INTERFACE_DATA, instance->params.altsetting
> +
> +	if (ret < 0) {

Why the extra blank line?

When learning to do kernel changes, I recommend doing so in
drivers/staging/ first, as that is what it is there for.  Only after
getting experience would I recommend doing this in other areas of the
kernel, and even then, only do checkpatch cleanups for code that you can
test, or that the subsystem maintainer has explicitly asked for.

good luck!

greg k-h

  reply	other threads:[~2024-10-04  6:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20241004030512.2036-1-sakunix.ref@yahoo.com>
2024-10-04  3:05 ` [PATCH] USB: atm: speedtch: do not use assignment in if condition Manuel Quintero F
2024-10-04  6:20   ` Greg KH [this message]
2024-10-05  9:50   ` kernel test robot
2024-10-05  9:50   ` kernel test robot
2024-10-05 10:11   ` kernel test robot

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=2024100400-whiff-unspoiled-0e1a@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=duncan.sands@free.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sakunix@yahoo.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;
as well as URLs for NNTP newsgroup(s).