Lines Matching defs:count
46 * Check the file size bounds and adjusts count as needed.
49 static inline size_t w1_f23_fix_count(loff_t off, size_t count, size_t size)
54 if ((off + count) > size)
57 return count;
91 loff_t off, size_t count)
101 if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0)
109 max_page = (off + count - 1) >> W1_PAGE_BITS;
112 count = -EIO;
116 memcpy(buf, &data->memory[off], count);
122 count = -EIO;
130 w1_read_block(sl->master, buf, count);
137 return count;
205 loff_t off, size_t count)
210 if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0)
215 if ((off & W1_PAGE_MASK) || (count & W1_PAGE_MASK)) {
216 dev_err(&sl->dev, "invalid offset/count off=%d cnt=%zd\n",
217 (int)off, count);
222 for (idx = 0; idx < count; idx += W1_PAGE_SIZE) {
234 while (idx < count) {
237 if (len > (count - idx))
238 len = count - idx;
241 count = -EIO;
250 return count;