From: "Chen, Yu C" <yu.c.chen@intel.com>
To: "joe@perches.com" <joe@perches.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Zhang, Rui" <rui.zhang@intel.com>,
"jslaby@suse.com" <jslaby@suse.com>,
"dvhart@infradead.org" <dvhart@infradead.org>,
"platform-driver-x86@vger.kernel.org"
<platform-driver-x86@vger.kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
"Westerberg, Mika" <mika.westerberg@intel.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"mchehab@osg.samsung.com" <mchehab@osg.samsung.com>,
"arnd@arndb.de" <arnd@arndb.de>
Subject: Re: [PATCH] [v2] surface pro 3: Add support driver for Surface Pro 3 buttons
Date: Fri, 7 Aug 2015 08:48:18 +0000 [thread overview]
Message-ID: <1438937513.2723.10.camel@localhost> (raw)
In-Reply-To: <1438936078.2322.29.camel@perches.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1467 bytes --]
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.
Best Regards,
Yu
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next prev parent reply other threads:[~2015-08-07 8:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-07 7:57 [PATCH] [v2] surface pro 3: Add support driver for Surface Pro 3 buttons Chen Yu
2015-08-07 8:27 ` Joe Perches
2015-08-07 8:48 ` Chen, Yu C [this message]
2015-08-11 2:45 ` Darren Hart
2015-08-18 1:42 ` Yu Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1438937513.2723.10.camel@localhost \
--to=yu.c.chen@intel.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=dvhart@infradead.org \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
--cc=mika.westerberg@intel.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox