Lines Matching +full:differ +full:-

1 // SPDX-License-Identifier: GPL-2.0-or-later
18 #define ROMFS_MTD_READ(sb, ...) mtd_read((sb)->s_mtd, ##__VA_ARGS__)
30 return (ret < 0 || rlen != buflen) ? -EIO : 0; in romfs_mtd_read()
53 return n + (p - buf); in romfs_mtd_strnlen()
54 maxlen -= len; in romfs_mtd_strnlen()
64 * - return 1 if matched, 0 if differ, -ve if error
82 len--; in romfs_mtd_strcmp()
86 size -= len; in romfs_mtd_strcmp()
112 offset = pos & (ROMBSIZE - 1); in romfs_blk_read()
113 segment = min_t(size_t, buflen, ROMBSIZE - offset); in romfs_blk_read()
116 return -EIO; in romfs_blk_read()
117 memcpy(buf, bh->b_data + offset, segment); in romfs_blk_read()
120 buflen -= segment; in romfs_blk_read()
141 offset = pos & (ROMBSIZE - 1); in romfs_blk_strnlen()
142 segment = min_t(size_t, limit, ROMBSIZE - offset); in romfs_blk_strnlen()
145 return -EIO; in romfs_blk_strnlen()
146 buf = bh->b_data + offset; in romfs_blk_strnlen()
150 return n + (p - buf); in romfs_blk_strnlen()
151 limit -= segment; in romfs_blk_strnlen()
161 * - return 1 if matched, 0 if differ, -ve if error
173 offset = pos & (ROMBSIZE - 1); in romfs_blk_strcmp()
174 segment = min_t(size_t, size, ROMBSIZE - offset); in romfs_blk_strcmp()
177 return -EIO; in romfs_blk_strcmp()
178 matched = (memcmp(bh->b_data + offset, str, segment) == 0); in romfs_blk_strcmp()
180 size -= segment; in romfs_blk_strcmp()
184 if (!bh->b_data[offset + segment]) in romfs_blk_strcmp()
197 BUG_ON((pos & (ROMBSIZE - 1)) != 0); in romfs_blk_strcmp()
200 return -EIO; in romfs_blk_strcmp()
201 matched = !bh->b_data[0]; in romfs_blk_strcmp()
220 if (pos >= limit || buflen > limit - pos) in romfs_dev_read()
221 return -EIO; in romfs_dev_read()
224 if (sb->s_mtd) in romfs_dev_read()
228 if (sb->s_bdev) in romfs_dev_read()
231 return -EIO; in romfs_dev_read()
244 return -EIO; in romfs_dev_strnlen()
245 if (maxlen > limit - pos) in romfs_dev_strnlen()
246 maxlen = limit - pos; in romfs_dev_strnlen()
249 if (sb->s_mtd) in romfs_dev_strnlen()
253 if (sb->s_bdev) in romfs_dev_strnlen()
256 return -EIO; in romfs_dev_strnlen()
261 * - the string to be compared to, str, may not be NUL-terminated; instead the
263 * - return 1 if matched, 0 if differ, -ve if error
272 return -EIO; in romfs_dev_strcmp()
274 return -ENAMETOOLONG; in romfs_dev_strcmp()
275 if (size + 1 > limit - pos) in romfs_dev_strcmp()
276 return -EIO; in romfs_dev_strcmp()
279 if (sb->s_mtd) in romfs_dev_strcmp()
283 if (sb->s_bdev) in romfs_dev_strcmp()
286 return -EIO; in romfs_dev_strcmp()