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:   Fri, 8 Dec 2017 11:30:15 -0800
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Benjamin Tissoires <benjamin.tissoires@...hat.com>
Cc:     Jiri Kosina <jikos@...nel.org>,
        Peter Hutterer <peter.hutterer@...-t.net>,
        linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] HID: use BIT macro instead of plain integers for
 flags

On Fri, Dec 08, 2017 at 03:28:17PM +0100, Benjamin Tissoires wrote:
> This can lead to some hairy situation with the developer losing
> a day or two realizing that 4 should be after 2, not 3.
> 
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@...hat.com>
> ---

Please add

#include <linux/bitops.h>

to make sure we have definition if BIT(), otherwise

Reviewed-by: Dmitry Torokhov <dmitry.torokhov@...il.com>

Thanks!

> 
> new in v2
> 
>  include/linux/hid.h | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/linux/hid.h b/include/linux/hid.h
> index a62ee4a609ac..421b62b77c69 100644
> --- a/include/linux/hid.h
> +++ b/include/linux/hid.h
> @@ -494,13 +494,13 @@ struct hid_output_fifo {
>  	char *raw_report;
>  };
>  
> -#define HID_CLAIMED_INPUT	1
> -#define HID_CLAIMED_HIDDEV	2
> -#define HID_CLAIMED_HIDRAW	4
> -#define HID_CLAIMED_DRIVER	8
> +#define HID_CLAIMED_INPUT	BIT(0)
> +#define HID_CLAIMED_HIDDEV	BIT(1)
> +#define HID_CLAIMED_HIDRAW	BIT(2)
> +#define HID_CLAIMED_DRIVER	BIT(3)
>  
> -#define HID_STAT_ADDED		1
> -#define HID_STAT_PARSED		2
> +#define HID_STAT_ADDED		BIT(0)
> +#define HID_STAT_PARSED		BIT(1)
>  
>  struct hid_input {
>  	struct list_head list;
> -- 
> 2.14.3
> 

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ