[PATCH] hwmon: Add missing parentheses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 19 Feb 2009 09:13:45 -0000 (GMT), alistair at 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.

Thanks.

> 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.

I don't think it is really important. The read functions never return
any error other than -EIO anyway. And there is nothing user-space can do
about the error code. So I doubt it is worth spending time on this.

-- 
Jean Delvare



[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux