From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Linux PCI <linux-pci@vger.kernel.org>,
Linux ACPI <linux-acpi@vger.kernel.org>,
Linux PM <linux-pm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH 2/3] ACPI / PM: Split acpi_device_wakeup()
Date: Fri, 21 Jul 2017 23:16:27 +0200 [thread overview]
Message-ID: <2663063.mdkNhtKpS0@aspire.rjw.lan> (raw)
In-Reply-To: <CAHp75Vdp8L7FXL85umQGGVyP-J_2dELssw0V8vKLEaCN6doMXg@mail.gmail.com>
On Saturday, July 22, 2017 12:19:51 AM Andy Shevchenko wrote:
> On Fri, Jul 21, 2017 at 11:49 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> > On Friday, July 21, 2017 06:27:39 PM Andy Shevchenko wrote:
> >> On Fri, Jul 21, 2017 at 3:40 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
>
> >> I prefer more self-explaining labels, though it's minor here
> >
> > Well, I prefer shorter ones.
> >
> >> To be constructive:
> >> out -> err_unlock
> >> out -> out_unlock or err_unlock (depends on context)
> >>
> >>
> >> > +out:
> >> > + mutex_unlock(&acpi_wakeup_lock);
> >> > + return error;
> >>
> >> > +out:
> >> > + mutex_unlock(&acpi_wakeup_lock);
> >>
> >>
> >
> > So while I don't have a particular problem with appending the "_unlock" to the
> > "out", I'm not exactly sure why this would be an improvement.
> >
> > If that's just a matter of personal preference, then I would prefer to follow
> > my personal preference here, with all due respect. [And besides, it follows
> > the general style of this file which matters too IMO.]
> >
> > But if there's more to it, just please let me know. :-)
>
> "Choose label names which say what the goto does or why the goto exists. An
> example of a good name could be ``out_free_buffer:`` if the goto frees
> ``buffer``.
> Avoid using GW-BASIC names like ``err1:`` and ``err2:``, as you would have to
> renumber them if you ever add or remove exit paths, and they make correctness
> difficult to verify anyway."
This is a totally made-up argument in this particular case.
Both of the functions in question are 1 screen long and you can *see* what
happens in there without even scrolling them.
Second, the subsequent patch actually *does* add a label to one of the without
renamling the existing one or such.
"out" pretty much represents the purpose of the goto in both cases and making
the label longer doesn't make it any better.
Thanks,
Rafael
next prev parent reply other threads:[~2017-07-21 21:16 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-21 12:36 [PATCH 0/3] PCI / ACPI / PM: Fix propagation of wakeup settings to bridges Rafael J. Wysocki
2017-07-21 12:38 ` [PATCH 1/3] PCI / PM: Skip bridges in pci_enable_wake() Rafael J. Wysocki
2017-07-25 12:44 ` Mika Westerberg
2017-07-31 20:53 ` Bjorn Helgaas
2017-07-31 20:59 ` Rafael J. Wysocki
2017-07-21 12:40 ` [PATCH 2/3] ACPI / PM: Split acpi_device_wakeup() Rafael J. Wysocki
2017-07-21 15:27 ` Andy Shevchenko
2017-07-21 20:49 ` Rafael J. Wysocki
2017-07-21 21:19 ` Andy Shevchenko
2017-07-21 21:16 ` Rafael J. Wysocki [this message]
2017-07-21 21:31 ` Andy Shevchenko
2017-07-21 21:25 ` Rafael J. Wysocki
2017-07-25 12:45 ` Mika Westerberg
2017-07-21 12:42 ` [PATCH 3/3] ACPI / PCI / PM: Rework acpi_pci_propagate_wakeup() Rafael J. Wysocki
2017-07-21 15:45 ` Andy Shevchenko
2017-07-21 20:44 ` Rafael J. Wysocki
2017-07-21 21:02 ` Rafael J. Wysocki
2017-07-21 21:30 ` [PATCH v2 " Rafael J. Wysocki
2017-07-21 21:43 ` Andy Shevchenko
2017-07-25 12:46 ` Mika Westerberg
2017-07-31 21:59 ` Bjorn Helgaas
2017-08-01 0:39 ` Rafael J. Wysocki
2017-08-01 0:56 ` [PATCH v3 " Rafael J. Wysocki
2017-07-28 0:34 ` [PATCH 0/3] PCI / ACPI / PM: Fix propagation of wakeup settings to bridges Rafael J. Wysocki
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=2663063.mdkNhtKpS0@aspire.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=andy.shevchenko@gmail.com \
--cc=bhelgaas@google.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mika.westerberg@linux.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