Questions rgd. patch "eeprom: at24: support eeproms that do not auto-rollover reads"

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

 



Sorry, I saw this patch only now and there my questions / remarks come
quite late. The intention of the change is clear, just the following:

In at24_adjust_read_count() there is the line
remainder = BIT(bits) - offset;

AFAICS we can have the case offset > BIT(bits). Imagine a 8 bit chip
with size 512 (2 addresses) and we try to read a few bytes from
offset 300. Then the line in question doesn't do what it's supposed
to do.

And a more general aspect: If the size is 512 but only 256 byte are
accessible then I doubt it's nice to create a nvmem provider with
size 512. Wouldn't it be better to adjust byte_len to reflect the
accessible size? Then we also wouldn't need the check in
at24_adjust_read_count.

Rgds, Heiner



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux