Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1740457 > unrolled thread
| Started by | Darren Hart <dvhart@infradead.org> |
|---|---|
| First post | 2017-09-27 09:40 +0200 |
| Last post | 2017-09-27 11:00 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] platform/x86: intel-hid: Power button suspend on Dell Latitude 7275 Darren Hart <dvhart@infradead.org> - 2017-09-27 09:40 +0200
Re: [PATCH] platform/x86: intel-hid: Power button suspend on Dell Latitude 7275 Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-09-27 11:00 +0200
| From | Darren Hart <dvhart@infradead.org> |
|---|---|
| Date | 2017-09-27 09:40 +0200 |
| Subject | Re: [PATCH] platform/x86: intel-hid: Power button suspend on Dell Latitude 7275 |
| Message-ID | <uuf6O-7P3-5@gated-at.bofh.it> |
On Mon, Sep 25, 2017 at 01:57:48PM +0300, Andy Shevchenko wrote:
> On Sat, Sep 23, 2017 at 2:45 AM, Darren Hart <dvhart@infradead.org> wrote:
> > On Mon, Sep 18, 2017 at 12:57:12AM +0200, Jérôme de Bretagne wrote:
>
> >> + if (event == 0xce) {
> >> + input_report_key(priv->input_dev, KEY_POWER, 1);
> >> + input_sync(priv->input_dev);
> >> + return;
> >> + } else if (event == 0xcf)
> >> + return;
> >
> > Minor CodingStyle nit. If the if block uses parens, so does the else block. In
> > this case, since the if returns, just skip the else entirely.
> >
> > See Documentation/process/coding-style.rst
> > The example immediatley *before* 3.1) Spaces.
> >
> > I've made this change and queued for testing.
> >
> >> + }
>
> Actually in this case even 'else' is redundant.
Yes, this is what I meant above by "skip the else entirely", and is the
change I made prior to committing. I was just pointing out the coding
style at the same time :-)
--
Darren Hart
VMware Open Source Technology Center
[toc] | [next] | [standalone]
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Date | 2017-09-27 11:00 +0200 |
| Message-ID | <uugmd-8tI-5@gated-at.bofh.it> |
| In reply to | #1740457 |
On Wed, Sep 27, 2017 at 10:31 AM, Darren Hart <dvhart@infradead.org> wrote:
> On Mon, Sep 25, 2017 at 01:57:48PM +0300, Andy Shevchenko wrote:
>> On Sat, Sep 23, 2017 at 2:45 AM, Darren Hart <dvhart@infradead.org> wrote:
>> > On Mon, Sep 18, 2017 at 12:57:12AM +0200, Jérôme de Bretagne wrote:
>>
>> >> + if (event == 0xce) {
>> >> + input_report_key(priv->input_dev, KEY_POWER, 1);
>> >> + input_sync(priv->input_dev);
>> >> + return;
>> >> + } else if (event == 0xcf)
>> >> + return;
>> >
>> > Minor CodingStyle nit. If the if block uses parens, so does the else block. In
>> > this case, since the if returns, just skip the else entirely.
>> >
>> > See Documentation/process/coding-style.rst
>> > The example immediatley *before* 3.1) Spaces.
>> >
>> > I've made this change and queued for testing.
>> >
>> >> + }
>>
>> Actually in this case even 'else' is redundant.
>
> Yes, this is what I meant above by "skip the else entirely", and is the
> change I made prior to committing. I was just pointing out the coding
> style at the same time :-)
Good we are on the same page WRT such pattern.
--
With Best Regards,
Andy Shevchenko
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web