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:   Thu, 05 Nov 2020 23:45:20 -0800
From:   Joe Perches <joe@...ches.com>
To:     Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Lee Jones <lee.jones@...aro.org>
Cc:     linux-kernel@...r.kernel.org, Henrik Rydberg <rydberg@...math.org>,
        Peter Osterlund <petero2@...ia.com>,
        Stefan Gmeiner <riddlebox@...esurf.ch>,
        "C. Scott Ananian" <cananian@...mni.priceton.edu>,
        Bruce Kalk <kall@...pass.com>,
        this to <linux-input@...r.kernel.org>
Subject: Re: [PATCH 10/20] input: mouse: synaptics: Place braces around
 empty if() body

On Thu, 2020-11-05 at 23:26 -0800, Dmitry Torokhov wrote:
> On Wed, Nov 04, 2020 at 04:24:17PM +0000, Lee Jones wrote:
> > Fixes the following W=1 kernel build warning(s):
> > 
> >  drivers/input/mouse/synaptics.c: In function ‘synaptics_process_packet’:
> >  drivers/input/mouse/synaptics.c:1110:6: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
[]
> > diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
[]
> > @@ -1106,8 +1106,9 @@ static void synaptics_process_packet(struct psmouse *psmouse)
> >  					num_fingers = hw.w + 2;
> >  				break;
> >  			case 2:
> > -				if (SYN_MODEL_PEN(info->model_id))
> > +				if (SYN_MODEL_PEN(info->model_id)) {
> >  					;   /* Nothing, treat a pen as a single finger */
> > +				}
> 
> This gives me:
> 
> WARNING: braces {} are not necessary for single statement blocks
> 
> from checkpatch.

As the entire case 2 is effectively a noop, why not just comment it better
and remove the if (SYN_MODEL_PEN(...)) test altogether.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ