Re: [PATCH] USB: atm: speedtch: do not use assignment in if condition
From: Greg KH
Date: Fri Oct 04 2024 - 02:20:19 EST
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@xxxxxxxxx>
> Signed-off-by: Manuel Quintero F <sakunix@xxxxxxxxx>
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