linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
Cc: "Michele De Candia (VT)"
	<michele.decandia-EZxuzQJkuwwybS5Ee8rs3A@public.gmane.org>,
	Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] TSL2550: extended mode bugfix
Date: Wed, 5 Aug 2009 17:22:46 +0200	[thread overview]
Message-ID: <20090805152245.GB3148@pengutronix.de> (raw)
In-Reply-To: <20090805171452.592a2bbd-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 583 bytes --]

> Operating on values before you check for errors is wrong. I'd rather do:
> 
>     ret = tsl2550_calculate_lux(ch0, ch1);
>     if (ret < 0)
>         return ret;
>     if (data->operating_mode == 1) /* extended mode */
>         ret *= 5;

I just wanted to suggest the same :) Pity that "operating_mode" is exported to
sysfs, "extended_mode" would have been a better name, me thinks...

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  parent reply	other threads:[~2009-08-05 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-05 15:08 [PATCH] TSL2550: extended mode bugfix Michele De Candia (VT)
     [not found] ` <4A79A055.1010602-EZxuzQJkuwwybS5Ee8rs3A@public.gmane.org>
2009-08-05 15:14   ` Jean Delvare
     [not found]     ` <20090805171452.592a2bbd-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-08-05 15:22       ` Wolfram Sang [this message]
     [not found]     ` <4A79AAF5.9000702@valueteam.com>
     [not found]       ` <4A79AAF5.9000702-EZxuzQJkuwwybS5Ee8rs3A@public.gmane.org>
2009-08-05 16:00         ` Wolfram Sang
2009-11-09 16:33         ` Jean Delvare

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=20090805152245.GB3148@pengutronix.de \
    --to=w.sang-bicnvbalz9megne8c9+irq@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=michele.decandia-EZxuzQJkuwwybS5Ee8rs3A@public.gmane.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;
as well as URLs for NNTP newsgroup(s).