From: Jonathan Woithe <jwoithe@just42.net>
To: Micha?? K??pie?? <kernel@kempniu.pl>
Cc: Darren Hart <dvhart@infradead.org>,
Andy Shevchenko <andy@infradead.org>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/7] platform/x86: fujitsu-laptop: Define constants for backlight power control
Date: Fri, 16 Feb 2018 21:20:14 +1030 [thread overview]
Message-ID: <20180216105014.GB25974@marvin.atrad.com.au> (raw)
In-Reply-To: <20180211210727.12130-7-kernel@kempniu.pl>
On Sun, Feb 11, 2018 at 10:07:26PM +0100, Micha?? K??pie?? wrote:
> Use named constants instead of integers in call_fext_func() invocations
> related to backlight power control in order to more clearly convey the
> intent of each call.
>
> Signed-off-by: Micha?? K??pie?? <kernel@kempniu.pl>
> ---
[cut]
> +/* FUNC interface - backlight power control */
> +#define BACKLIGHT_POWER 0x4
> +#define BACKLIGHT_OFF 0x3
> +#define BACKLIGHT_ON 0x0
A minor detail: BACKLIGHT_OFF and BACKLIGHT_ON are potential parameter
values while BACKLIGHT_POWER is essentially a parameter selector. Should
the name of BACKLIGHT_POWER reflect this difference? It could be difficult
to do without making the resulting identifier a little long. The best I can
come up with is BACKLIGHT_PARAM_POWER or (if a saving of one character is
desired) BACKLIGHT_PARM_POWER.
[cut]
> @@ -818,7 +825,8 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device)
> /* Sync backlight power status */
> if (fujitsu_bl && fujitsu_bl->bl_device &&
> acpi_video_get_backlight_type() == acpi_backlight_vendor) {
> - if (call_fext_func(fext, FUNC_BACKLIGHT, 0x2, 0x4, 0x0) == 3)
> + if (call_fext_func(fext, FUNC_BACKLIGHT, 0x2, BACKLIGHT_POWER,
> + 0x0) == 3)
> fujitsu_bl->bl_device->props.power = FB_BLANK_POWERDOWN;
> else
> fujitsu_bl->bl_device->props.power = FB_BLANK_UNBLANK;
I'm curious: this fext function call is, I think, returning the current
backlight power value. If that's the case, is the value of 3 used in the
test of the return function conceptually BACKLIGHT_OFF, and if so, should we
use BACKLIGHT_OFF instead of the numeric constant? It seems likely given
that it results in the backlight power property being set to
FB_BLANK_POWERDOWN.
Regards
jonathan
next prev parent reply other threads:[~2018-02-16 11:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-11 21:07 [PATCH 0/7] fujitsu-laptop: Miscellaneous cleanups Michał Kępień
2018-02-11 21:07 ` [PATCH 1/7] platform/x86: fujitsu-laptop: Unify local variable naming Michał Kępień
2018-02-11 21:07 ` [PATCH 2/7] platform/x86: fujitsu-laptop: Defer input device registration Michał Kępień
2018-02-11 21:07 ` [PATCH 3/7] platform/x86: fujitsu-laptop: Simplify error paths Michał Kępień
2018-02-11 21:07 ` [PATCH 4/7] platform/x86: fujitsu-laptop: Clearly distinguish module parameters Michał Kępień
2018-02-11 21:07 ` [PATCH 5/7] platform/x86: fujitsu-laptop: Do not include linux/slab.h Michał Kępień
2018-02-11 21:07 ` [PATCH 6/7] platform/x86: fujitsu-laptop: Define constants for backlight power control Michał Kępień
2018-02-16 10:50 ` Jonathan Woithe [this message]
2018-02-18 19:51 ` Michał Kępień
2018-02-11 21:07 ` [PATCH 7/7] platform/x86: fujitsu-laptop: Clean up constants Michał Kępień
2018-02-11 21:20 ` Randy Dunlap
2018-02-11 21:35 ` Michał Kępień
2018-02-16 10:57 ` [PATCH 0/7] fujitsu-laptop: Miscellaneous cleanups Jonathan Woithe
2018-02-16 19:37 ` Darren Hart
2018-02-18 19:55 ` Michał Kępień
2018-02-23 1:16 ` Darren Hart
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=20180216105014.GB25974@marvin.atrad.com.au \
--to=jwoithe@just42.net \
--cc=andy@infradead.org \
--cc=dvhart@infradead.org \
--cc=kernel@kempniu.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/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
all inboxes | Powered by JetHome®