From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Date: Thu, 19 Feb 2009 09:28:11 +0000 Subject: Re: [lm-sensors] [PATCH] hwmon: Add missing parentheses Message-Id: <499D262B.2080102@redhat.com> List-Id: References: <499AB902.1080308@gmail.com> In-Reply-To: <499AB902.1080308@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lm-sensors@vger.kernel.org alistair@devzero.co.uk wrote: > (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. > Note: I've never ever seen an actual IO-error with the uguru3 (unlike the revision 1), so i'm not sure this is worth your while. Regards, Hans _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors