[PATCH 4/8] staging: rts5208: Logical continuation fixes

Joe Perches joe at perches.com
Mon Oct 3 23:25:48 UTC 2016


On Mon, 2016-10-03 at 23:17 +0000, Wayne Porter wrote:
> Checkpatch detected multiple instances of logical continuation warnings
[]
> diff --git a/drivers/staging/rts5208/xd.c b/drivers/staging/rts5208/xd.c
[]
> @@ -819,11 +819,11 @@ static int reset_xd(struct rtsx_chip *chip)
>  			}
>  
>  			if ((buf[0] == 0x01) && (buf[1] == 0x03) &&
> -			    (buf[2] == 0xD9)
> -			    && (buf[3] == 0x01) && (buf[4] == 0xFF)
> -			    && (buf[5] == 0x18) && (buf[6] == 0x02)
> -			    && (buf[7] == 0xDF) && (buf[8] == 0x01)
> -			    && (buf[9] == 0x20)) {
> +			    (buf[2] == 0xD9) &&
> +			    (buf[3] == 0x01) && (buf[4] == 0xFF) &&
> +			    (buf[5] == 0x18) && (buf[6] == 0x02) &&
> +			    (buf[7] == 0xDF) && (buf[8] == 0x01) &&
> +			    (buf[9] == 0x20)) {

memcmp might be easier to read

	if (!memcmp(buf, "\x01\x03\xd9\x01\xff\x18\x02\xdf\x01\x20", 10))


More information about the devel mailing list