Lines Matching defs:count
57 * Check the file size bounds and adjusts count as needed.
60 static inline size_t w1_f1C_fix_count(loff_t off, size_t count, size_t size)
65 if ((off + count) > size)
68 return count;
116 loff_t off, size_t count)
122 count = w1_f1C_fix_count(off, count, W1_EEPROM_SIZE);
123 if (count == 0)
130 max_page = (off + count - 1) >> W1_PAGE_BITS;
133 count = -EIO;
137 memcpy(buf, &data->memory[off], count);
139 count = w1_f1C_read(sl, off, count, buf);
145 return count;
224 loff_t off, size_t count)
230 count = w1_f1C_fix_count(off, count, W1_EEPROM_SIZE);
231 if (count == 0)
236 if ((off & W1_PAGE_MASK) || (count & W1_PAGE_MASK)) {
237 dev_err(&sl->dev, "invalid offset/count off=%d cnt=%zd\n",
238 (int)off, count);
243 for (idx = 0; idx < count; idx += W1_PAGE_SIZE) {
257 while (idx < count) {
260 if (len > (count - idx))
261 len = count - idx;
264 count = -EIO;
273 return count;
280 size_t count)
287 if (off != 0 || count != 1 || buf == NULL)
291 ret = w1_f1C_read(sl, W1_1C_REG_LOGIC_STATE, count, buf);
299 size_t count)
307 if (off != 0 || count != 1 || buf == NULL)
334 return count;
346 const char *buf, size_t count)
353 return count;