lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 11 Mar 2015 14:21:38 -0700
From:	Joe Perches <joe@...ches.com>
To:	Janakarajan Natarajan <janakarajann@...il.com>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	devel@...verdev.osuosl.org,
	Marek Belisko <marek.belisko@...il.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] Drivers: Staging: ft1000: checkpatch warning fixes

On Wed, 2015-03-11 at 14:03 -0700, Janakarajan Natarajan wrote:
> Addition of blank line after declaration in ft1000_hw.c
> Minor changes to remove {} from single line if and remove extra parenthesis.
> Fixes checkpatch warning for <asm/bitops.h> and <asm/io.h> usage.

Most prefer separate patches for each type of change,
so this single patch could be 3 patches.

> diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c

and for more trivia:

> @@ -1948,11 +1948,11 @@ static irqreturn_t ft1000_interrupt(int irq, void *dev_id)
>  						ft1000_read_reg(dev,
>  								FT1000_REG_MAG_DFSR);
>  				}
> -				if (tempword & 0x1f) {
> +				if (tempword & 0x1f)
>  					ft1000_copy_up_pkt(dev);
> -				} else {
> +				else
>  					break;
> -				}
> +
>  				cnt++;
>  			} while (cnt < MAX_RCV_LOOP);

	do {
		if (foo)
			bar;
		else
			break;
	} while (baz);

is generally better written

	do {
		if (!foo)
			break;
		bar;
	} while (baz);

so

				if (!(tempword & 0x1f))
					break;

				ft100_copy_up_pkt(dev);
				cnt++;
			} while (cnt < MAX_RCV_LOOP);

or maybe

				if (!(tempword & 0x1f))
					break;

				ft100_copy_up_pkt(dev);
			} while (++cnt < MAX_RCV_LOOP);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ