Lines Matching refs: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;
227 loff_t off, size_t count)
233 count = w1_f1C_fix_count(off, count, W1_EEPROM_SIZE);
234 if (count == 0)
239 if ((off & W1_PAGE_MASK) || (count & W1_PAGE_MASK)) {
240 dev_err(&sl->dev, "invalid offset/count off=%d cnt=%zd\n",
241 (int)off, count);
246 for (idx = 0; idx < count; idx += W1_PAGE_SIZE) {
260 while (idx < count) {
263 if (len > (count - idx))
264 len = count - idx;
267 count = -EIO;
276 return count;
283 size_t count)
290 if (off != 0 || count != 1 || buf == NULL)
294 ret = w1_f1C_read(sl, W1_1C_REG_LOGIC_STATE, count, buf);
302 size_t count)
310 if (off != 0 || count != 1 || buf == NULL)
337 return count;
349 const char *buf, size_t count)
356 return count;