Re: [PATCH] checkpatch: Attempt to find missing switch/case break;

From: Jiri Kosina
Date: Fri Dec 13 2013 - 16:01:03 EST


On Fri, 13 Dec 2013, Joe Perches wrote:

> Also tested on all files in drivers/hid/
>
> There is a hit for drivers/hid/hid-microsoft.c
>
> I've no idea what's right here but adding a break or return
> or a "fall-through" comment would be nicer.
>
> static int ms_ergonomy_kb_quirk(struct hid_input *hi, struct hid_usage *usage,
> unsigned long **bit, int *max)
> {
> struct input_dev *input = hi->input;
>
> switch (usage->hid & HID_USAGE) {
> case 0xfd06: ms_map_key_clear(KEY_CHAT); break;
> case 0xfd07: ms_map_key_clear(KEY_PHONE); break;
> case 0xff05:
> set_bit(EV_REP, input->evbit);
> ms_map_key_clear(KEY_F13);
> set_bit(KEY_F14, input->keybit);
> set_bit(KEY_F15, input->keybit);
> set_bit(KEY_F16, input->keybit);
> set_bit(KEY_F17, input->keybit);
> set_bit(KEY_F18, input->keybit);
> default:
> return 0;
> }
> return 1;
> }

This is indeed a bug. I'll fix it with your Reported-by:, thanks.

--
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/