From: Andy Whitcroft <apw@canonical.com>
To: Harald Welte <laforge@gnumonks.org>
Cc: linux-kernel@vger.kernel.org
Subject: panasonic-laptop driver oddity
Date: Thu, 15 Jan 2009 15:47:17 +0000 [thread overview]
Message-ID: <20090115154717.GC6896@shadowen.org> (raw)
We have been looking at your panasonic-laptop driver with a view to
back porting it to 2.6.27, and the following inconsistancy was pointed
out to me. In bl_set_status() we ensure that bright is no lower than
sinf[SINF_AC_MIN_BRIGHT] and sinf[SINF_DC_MIN_BRIGHT], and then check if
it is lower than sinf[SINF_AC_MIN_BRIGHT]. That seems redundant.
static int bl_set_status(struct backlight_device *bd)
{
struct pcc_acpi *pcc = bl_get_data(bd);
int bright = bd->props.brightness;
int rc;
if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf))
return -EIO;
if (bright < pcc->sinf[SINF_AC_MIN_BRIGHT])
bright = pcc->sinf[SINF_AC_MIN_BRIGHT];
if (bright < pcc->sinf[SINF_DC_MIN_BRIGHT])
bright = pcc->sinf[SINF_DC_MIN_BRIGHT];
if (bright < pcc->sinf[SINF_AC_MIN_BRIGHT] ||
bright > pcc->sinf[SINF_AC_MAX_BRIGHT])
return -EINVAL;
We could not decide if this was simply belt and braces to constrain the
value, or if this should be a check against sinf[SINF_DC_MAX_BRIGHT].
Perhaps you could clarify?
-apw
reply other threads:[~2009-01-15 15:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20090115154717.GC6896@shadowen.org \
--to=apw@canonical.com \
--cc=laforge@gnumonks.org \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.