[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150811024524.GA3095@vmdeb7>
Date: Mon, 10 Aug 2015 19:45:24 -0700
From: Darren Hart <dvhart@...radead.org>
To: "Chen, Yu C" <yu.c.chen@...el.com>
Cc: "joe@...ches.com" <joe@...ches.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Zhang, Rui" <rui.zhang@...el.com>,
"jslaby@...e.com" <jslaby@...e.com>,
"platform-driver-x86@...r.kernel.org"
<platform-driver-x86@...r.kernel.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"Wysocki, Rafael J" <rafael.j.wysocki@...el.com>,
"Westerberg, Mika" <mika.westerberg@...el.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"mchehab@....samsung.com" <mchehab@....samsung.com>,
"arnd@...db.de" <arnd@...db.de>
Subject: Re: [PATCH] [v2] surface pro 3: Add support driver for Surface Pro 3
buttons
On Fri, Aug 07, 2015 at 08:48:18AM +0000, Chen, Yu C wrote:
> On Fri, 2015-08-07 at 01:27 -0700, Joe Perches wrote:
> > On Fri, 2015-08-07 at 15:57 +0800, Chen Yu wrote: \
> > > + ret; \
> > > +})
> >
> > This seems a bit complicated.
> >
> > The else ret = 0 isn't necessary as it's initialized to 0.
> > bool might be better than int.
> >
> Got.
> > > +static void surface_button_notify(struct acpi_device *device, u32 event)
> > > +{
> > > + struct surface_button *button = acpi_driver_data(device);
> > > + struct input_dev *input;
> > > + int key_code = KEY_RESERVED;
> > > + bool pressed = false;
> > > +
> > > + if (!handle_surface_button_notify(POWER, KEY_POWER) &&
> > > + !handle_surface_button_notify(HOME, KEY_LEFTMETA) &&
> > > + !handle_surface_button_notify(VOLUME_UP, KEY_VOLUMEUP) &&
> > > + !handle_surface_button_notify(VOLUME_DOWN, KEY_VOLUMEDOWN))
> > > + dev_info_ratelimited(&device->dev,
> > > + "Unsupported event [0x%x]\n", event);
> >
> > Some might prefer alignment to the open parenthesis:
> >
> > if (!handle_surface_button_notify(POWER, KEY_POWER) &&
> > !handle_surface_button_notify(HOME, KEY_LEFTMETA) &&
> > !handle_surface_button_notify(VOLUME_UP, KEY_VOLUMEUP) &&
> > !handle_surface_button_notify(VOLUME_DOWN, KEY_VOLUMEDOWN))
> >
> > I think the older switch/case was easier to understand.
> >
> OK, then let's keep the switch/case.
> thanks.
Agreed.
--
Darren Hart
Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists