Re: Need help determining if the change is warranted.

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

 



On Sat, 27 May 2023 07:05:40 +0100, Lucas Tanure said:

> It's unusual for an I2C bus would suddenly stop working, so just one
> check at the beginning of the function is enough.
> I would remove all ret assignments apart from the first one for every
> function on that driver.

By the same token, it's somewhat unusual for an I2C bus to stop working
once it's been probed and initialized, so maybe the first one is superfluous
as well :)  (Just playing devil's advocate here - after 4 decades of this stuff,
I've hit enough systems that have gotten wedged on unusual situations. The worst
one was an 18 month chase for why on occasion a petabyte-scale disk array
hanging off a bunch of FiberChannel connections would read from the wrong LUN.
We finally figured out it was actually a firmware bug in the 10Gig ethernet card.

But probably the best advice is this one variously attributed to Tom Duff
at Bell Labs (yeah the guy who came up with the Duff Device) or Henry Spencer:

Never test for an error condition you don't know how to handle....

(And that 10gig issue probably needed Casey  Schaufler of SGI's suggested
error code:

-EGADS - Violates the principle of least surprise.

Attachment: pgpHsVZi88naH.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux