2011-06-01 22:03:39

by Simon Budig

[permalink] [raw]
Subject: Patch to add guarding parentheses to some macros in linux/input.h

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all.

This is a patch to add guarding parentheses around some macro argument
uses. This is good practice to avoid pitfalls like this:

ioctl (fd, EVIOCGABS (have_mt ? ABS_MT_POSITION_X : ABS_X), &abs);

Which currently totally does not do what is expected.

The attached patch adds parentheses to ensure correct operator precedence.

Please consider this for inclusion into the Linux Kernel.

Thanks,
Simon
- --
Simon Budig kernel concepts GbR
[email protected] Sieghuetter Hauptweg 48
+49-271-771091-17 D-57072 Siegen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3mrToACgkQO2O/RXesiHBWcQCfdYFhFgKGaxvE5szwIJe3vfNO
yy4AoJssXo0zvSYeVJqA/ViOVlq/ITyj
=jtQG
-----END PGP SIGNATURE-----


Attachments:
input-fix-macros.patch (2.81 kB)

2011-06-07 10:51:17

by Simon Budig

[permalink] [raw]
Subject: Re: Patch to add guarding parentheses to some macros in linux/input.h

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/01/2011 11:20 PM, Simon Budig wrote:
> The attached patch adds parentheses to ensure correct operator precedence.

Seems this patch did not draw any attention to it. Is this because it is
somewhat pointless? Or is it too uncontroversial? :-)

I'd appreciate any hints on how to proceed from here.

Thanks,
Simon

- --
Simon Budig kernel concepts GbR
[email protected] Sieghuetter Hauptweg 48
+49-271-771091-17 D-57072 Siegen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3uAqAACgkQO2O/RXesiHD8bwCfZz10ADGqx0yUbPJCSlmvNthL
JZsAn2Mc+gj1UQ5nSAWGonf46s6Xg/Uq
=Ug6H
-----END PGP SIGNATURE-----