# Patch to add guarding parentheses to some macros in linux/input.h

- From: Simon Budig \<hidden\>
- Date: 2011-06-01 22:03:39 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2011/06/3723764
- Thread: https://ratatoskr.run/linux-input/2011/06/3723764/t.md

```text
-----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
       simon.budig@kernelconcepts.de      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](https://ratatoskr.run/linux-input/2011/06/3723764/attachment/0) (text/x-patch, 2879 bytes)
