Re: [PATCH v3] HID: add vivaldi HID driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2020-09-09 at 15:03 -0700, Sean O'Brien wrote:
> Add vivaldi HID driver. This driver allows us to read and report the top
> row layout of keyboards which provide a vendor-defined (Google) HID
> usage.
[]
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
[]
> @@ -814,6 +814,13 @@ static void hid_scan_collection(struct hid_parser *parser, unsigned type)
>  
>  	if ((parser->global.usage_page << 16) >= HID_UP_MSVENDOR)
>  		parser->scan_flags |= HID_SCAN_FLAG_VENDOR_SPECIFIC;
> +
> +	if ((parser->global.usage_page << 16) == HID_UP_GOOGLEVENDOR)
> +		for (i = 0; i < parser->local.usage_index; i++)
> +			if (parser->local.usage[i] ==
> +					(HID_UP_GOOGLEVENDOR | 0x0001))
> +				parser->device->group =
> +					HID_GROUP_VIVALDI;

Can you please make this less indented code
so there are fewer line breaks?

Something like:

	if ((parser->global.usage_page << 16) != HID_UP_GOOGLEVENDOR)
		return;

	for (i = 0; i < parser->local.usage_index; i++) {
		if (parser->local.usage[i] != (HID_UP_GOOGLEVENDOR | 0x0001))
			continue;
		parser->device->group = HID_GROUP_VIVALDI;
		break;
	}





[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux