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]
Message-ID: <1505511108.27581.16.camel@perches.com>
Date:   Fri, 15 Sep 2017 14:31:48 -0700
From:   Joe Perches <joe@...ches.com>
To:     Srishti Sharma <srishtishar@...il.com>, samuel@...tiz.org
Cc:     gregkh@...uxfoundation.org, netdev@...r.kernel.org,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        outreachy-kernel@...glegroups.com
Subject: Re: [PATCH 2/2] Staging: irda: Remove parentheses on the right of
 assignment

On Sat, 2017-09-16 at 02:36 +0530, Srishti Sharma wrote:
> Parentheses are not needed on the right hand side of assignment
> statement in most cases. Done using the following semantic
> patch by coccinelle.
[]
> @@
> identifier E,F,G,f;
> expression e,r;
> @@
> 
> (
> E = (G == F);
> > 
> 
> E = (e == r);
> > 
> 
> E =
> -(
> ...
> -)
> ;
> )
[]
> diff --git a/drivers/staging/irda/drivers/mcs7780.c b/drivers/staging/irda/drivers/mcs7780.c
[]
> @@ -605,7 +605,7 @@ static int mcs_speed_change(struct mcs_cb *mcs)
>  	if (mcs->new_speed <= 115200) {
>  		rval &= ~MCS_FIR;
>  
> -		rst = (mcs->speed > 115200);
> +		rst = mcs->speed > 115200;
>  		if (rst)
>  			mcs_set_reg(mcs, MCS_MINRXPW_REG, 0);

Coccinelle is a good tool, but its output is limited to
the correctness
and completeness of its input script.

Please look at the suggested modifications of the script
and examine the code for other similar uses.

The else if block immediately below this is:

	} else if (mcs->new_speed <= 1152000) {
		rval &= ~MCS_FIR;

		if ((rst = !(mcs->speed == 576000 || mcs->speed == 11520
00)))
			mcs_set_reg(mcs, MCS_MINRXPW_REG, 5);

which should also be corrected by this patch.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ