From: alistair@devzero.co.uk
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] hwmon: Add missing parentheses
Date: Thu, 19 Feb 2009 09:13:45 +0000 [thread overview]
Message-ID: <fc7211cc6126fa2b054b50e2244b635f.squirrel@mail.devzero.co.uk> (raw)
In-Reply-To: <499AB902.1080308@gmail.com>
(Sorry for the delay and probable mail corruption, I'm travelling)
[snip]
> for (i = 0; i < offset_count; i++)
> if ((x = abituguru3_read(data, bank, offset + i, count,
> - buf + i * count)) != count)
> - return i * count + (i && (x < 0)) ? 0 : x;
> + buf + i * count)) != count) {
> + if (x < 0)
> + return x;
> + return i * count + x;
> + }
>
> return i * count;
> }
>
> Objections?
I have no objections to this patch.
However, if propagating errors up the stack is desirable, I think it would
also be prudent to fix abituguru3_update_device() to pass the error back
via ERR_PTR() or similar, instead of returning NULL. That way,
show_value(), show_alarm() and abituguru3_probe() could return f.e. -EIO,
generated by abituguru3_read().
This change is more involved; I can send a follow up for a later
time-frame if desired.
--
Cheers,
Alistair.
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2009-02-19 9:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-17 13:17 [lm-sensors] [PATCH] hwmon: Add missing parentheses Roel Kluin
2009-02-17 21:03 ` Alistair John Strachan
2009-02-18 13:17 ` Jean Delvare
2009-02-18 14:25 ` Hans de Goede
2009-02-18 15:15 ` Jean Delvare
2009-02-18 15:15 ` Hans de Goede
2009-02-19 9:13 ` alistair [this message]
2009-02-19 9:28 ` Hans de Goede
2009-02-19 9:41 ` 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=fc7211cc6126fa2b054b50e2244b635f.squirrel@mail.devzero.co.uk \
--to=alistair@devzero.co.uk \
--cc=lm-sensors@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.