Re: [PATCH] surface pro 3: Add support driver for Surface Pro 3 buttons

From: Joe Perches
Date: Thu Aug 06 2015 - 10:54:46 EST


On Thu, 2015-08-06 at 11:20 +0000, Chen, Yu C wrote:
> On Wed, 2015-08-05 at 22:30 -0700, Joe Perches wrote:
[]
> > > + case SURFACE_BUTTON_NOTIFY_PRESS_HOME:
> > > + pressed = true;
> > > + case SURFACE_BUTTON_NOTIFY_RELEASE_HOME:
> > > + key_code = KEY_LEFTMETA;
> > > + break;
> >
> > It may be better to add a comment about the style or
> > maybe add a macro like
> >
> > #define HANDLE_SURFACE_BUTTON_NOTIFY(type, code) \
> > case SURFACE_BUTTON_NOTIFY_PRESS_##type: \
> > pressed = true; /* and fall-through */ \
> > case SURFACE_BUTTON_NOTIFY_RELEASE_##type: \
> > key_code = code; \
> > break;
> >
> WRT macro HANDLE_SURFACE_BUTTON_NOTIFY, the checkpatch.pl
> complains that multi lines of codes should be wrapped in 'do
> while'state, but doing like this might lead to incorrect semantic.

checkpatch is a brainless tool that should be ignored
whenever you want.

> Is it ok to keep these codes and add comments like:

Up to you. It'd OK to do nothing too.


--
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/