Re: [PATCH] at24: support eeproms that do not roll over page reads.
From: kbuild test robot
Date: Wed Nov 01 2017 - 00:32:49 EST
Hi Sven,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v4.14-rc7]
[cannot apply to next-20171018]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Sven-Van-Asbroeck/at24-support-eeproms-that-do-not-roll-over-page-reads/20171101-114231
config: tile-allyesconfig (attached as .config)
compiler: tilegx-linux-gcc (GCC) 4.6.2
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=tile
All warnings (new ones prefixed by >>):
drivers/misc/eeprom/at24.c: In function 'at24_translate_offset':
>> drivers/misc/eeprom/at24.c:210:12: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vim +210 drivers/misc/eeprom/at24.c
185
186 /*
187 * This routine supports chips which consume multiple I2C addresses. It
188 * computes the addressing information to be used for a given r/w request.
189 * Assumes that sanity checks for offset happened at sysfs-layer.
190 *
191 * Slave address and byte offset derive from the offset. Always
192 * set the byte address; on a multi-master board, another master
193 * may have changed the chip's "current" address pointer.
194 *
195 * In case of chips that don't rollover page reads, truncate the count
196 * to the nearest page boundary. This might result in the
197 * at24_eeprom_read_XXX functions reading fewer bytes than requested,
198 * but this is compensated for in at24_read().
199 */
200 static struct i2c_client *at24_translate_offset(struct at24_data *at24,
201 unsigned int *offset, size_t *count)
202 {
203 unsigned int i, bits, remainder;
204
205 bits = (at24->chip.flags & AT24_FLAG_ADDR16) ? 16 : 8;
206 i = *offset >> bits;
207 *offset &= AT24_BITMASK(bits);
208 if ((at24->chip.flags & AT24_FLAG_NO_RDROL) && count) {
209 remainder = BIT(bits) - *offset;
> 210 *count = min(*count, remainder);
211 }
212
213 return at24->client[i];
214 }
215
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip