Home
last modified time | relevance | path

Searched refs:count (Results 1 – 25 of 47) sorted by relevance

12

/lib/
Dlockref.c47 new.count++; in lockref_get()
53 lockref->count++; in lockref_get()
68 new.count++; in lockref_get_not_zero()
69 if (old.count <= 0) in lockref_get_not_zero()
77 if (lockref->count > 0) { in lockref_get_not_zero()
78 lockref->count++; in lockref_get_not_zero()
96 new.count--; in lockref_put_not_zero()
97 if (old.count <= 1) in lockref_put_not_zero()
105 if (lockref->count > 1) { in lockref_put_not_zero()
106 lockref->count--; in lockref_put_not_zero()
[all …]
Dstring.c114 char *strncpy(char *dest, const char *src, size_t count) in strncpy() argument
118 while (count) { in strncpy()
122 count--; in strncpy()
180 ssize_t strscpy(char *dest, const char *src, size_t count) in strscpy() argument
183 size_t max = count; in strscpy()
186 if (count == 0 || WARN_ON_ONCE(count > INT_MAX)) in strscpy()
217 count -= sizeof(unsigned long); in strscpy()
221 while (count) { in strscpy()
229 count--; in strscpy()
261 ssize_t strscpy_pad(char *dest, const char *src, size_t count) in strscpy_pad() argument
[all …]
Diomap.c41 static int count = 10; in bad_io_access() local
42 if (count) { in bad_io_access()
43 count--; in bad_io_access()
278 static inline void mmio_insb(void __iomem *addr, u8 *dst, int count) in mmio_insb() argument
280 while (--count >= 0) { in mmio_insb()
286 static inline void mmio_insw(void __iomem *addr, u16 *dst, int count) in mmio_insw() argument
288 while (--count >= 0) { in mmio_insw()
294 static inline void mmio_insl(void __iomem *addr, u32 *dst, int count) in mmio_insl() argument
296 while (--count >= 0) { in mmio_insl()
305 static inline void mmio_outsb(void __iomem *addr, const u8 *src, int count) in mmio_outsb() argument
[all …]
Dpercpu_counter.c70 fbc->count = amount; in percpu_counter_set()
84 s64 count; in percpu_counter_add_batch() local
87 count = __this_cpu_read(*fbc->counters) + amount; in percpu_counter_add_batch()
88 if (count >= batch || count <= -batch) { in percpu_counter_add_batch()
91 fbc->count += count; in percpu_counter_add_batch()
92 __this_cpu_sub(*fbc->counters, count - amount); in percpu_counter_add_batch()
112 ret = fbc->count; in __percpu_counter_sum()
129 fbc->count = amount; in __percpu_counter_init()
189 fbc->count += *pcount; in percpu_counter_cpu_dead()
204 s64 count; in __percpu_counter_compare() local
[all …]
Dstrncpy_from_user.c28 unsigned long count, unsigned long max) in do_strncpy_from_user() argument
68 if (res >= count) in do_strncpy_from_user()
97 long strncpy_from_user(char *dst, const char __user *src, long count) in strncpy_from_user() argument
101 if (unlikely(count <= 0)) in strncpy_from_user()
114 if (max > count) in strncpy_from_user()
115 max = count; in strncpy_from_user()
117 kasan_check_write(dst, count); in strncpy_from_user()
118 check_object_size(dst, count, false); in strncpy_from_user()
120 retval = do_strncpy_from_user(dst, src, count, max); in strncpy_from_user()
Dstrnlen_user.c23 static inline long do_strnlen_user(const char __user *src, unsigned long count, unsigned long max) in do_strnlen_user() argument
60 if (res >= count) in do_strnlen_user()
61 return count+1; in do_strnlen_user()
92 long strnlen_user(const char __user *str, long count) in strnlen_user() argument
96 if (unlikely(count <= 0)) in strnlen_user()
109 if (max > count) in strnlen_user()
110 max = count; in strnlen_user()
113 retval = do_strnlen_user(str, count, max); in strnlen_user()
Diomap_copy.c21 size_t count) in __iowrite32_copy() argument
25 const u32 *end = src + count; in __iowrite32_copy()
42 void __ioread32_copy(void *to, const void __iomem *from, size_t count) in __ioread32_copy() argument
46 const u32 __iomem *end = src + count; in __ioread32_copy()
65 size_t count) in __iowrite64_copy() argument
70 const u64 *end = src + count; in __iowrite64_copy()
75 __iowrite32_copy(to, from, count * 2); in __iowrite64_copy()
Dtest_strscpy.c29 static int __init tc(char *src, int count, int expected, in tc() argument
50 max_expected = count - 1; /* Space for the null */ in tc()
51 if (count > max_count) { in tc()
52 pr_err("count (%d) is too big (%d) ... aborting", count, max_count); in tc()
60 written = strscpy_pad(buf, src, count); in tc()
66 if (count && written == -E2BIG) { in tc()
67 if (strncmp(buf, src, count - 1) != 0) { in tc()
71 if (buf[count - 1] != '\0') { in tc()
85 if (buf[count - 1] != '\0') { in tc()
Doid_registry.c112 int count; in sprint_oid() local
118 ret = count = snprintf(buffer, bufsize, "%u.%u", n / 40, n % 40); in sprint_oid()
119 if (count >= bufsize) in sprint_oid()
121 buffer += count; in sprint_oid()
122 bufsize -= count; in sprint_oid()
139 ret += count = snprintf(buffer, bufsize, ".%lu", num); in sprint_oid()
140 if (count >= bufsize) in sprint_oid()
142 buffer += count; in sprint_oid()
143 bufsize -= count; in sprint_oid()
Dtest_firmware.c165 static int __kstrncpy(char **dst, const char *name, size_t count, gfp_t gfp) in __kstrncpy() argument
167 *dst = kstrndup(name, count, gfp); in __kstrncpy()
170 return count; in __kstrncpy()
199 const char *buf, size_t count) in reset_store() argument
216 ret = count; in reset_store()
270 const char *buf, size_t count) in config_name_store() argument
276 ret = __kstrncpy(&test_fw_config->name, buf, count, GFP_KERNEL); in config_name_store()
377 const char *buf, size_t count) in config_num_requests_store() argument
390 rc = test_dev_config_update_u8(buf, count, in config_num_requests_store()
407 const char *buf, size_t count) in config_into_buf_store() argument
[all …]
Dpercpu-refcount.c87 atomic_long_set(&ref->count, start_count); in percpu_ref_init()
137 unsigned long count = 0; in percpu_ref_switch_to_atomic_rcu() local
141 count += *per_cpu_ptr(percpu_count, cpu); in percpu_ref_switch_to_atomic_rcu()
144 atomic_long_read(&ref->count), (long)count); in percpu_ref_switch_to_atomic_rcu()
158 atomic_long_add((long)count - PERCPU_COUNT_BIAS, &ref->count); in percpu_ref_switch_to_atomic_rcu()
160 WARN_ONCE(atomic_long_read(&ref->count) <= 0, in percpu_ref_switch_to_atomic_rcu()
162 ref->release, atomic_long_read(&ref->count)); in percpu_ref_switch_to_atomic_rcu()
207 atomic_long_add(PERCPU_COUNT_BIAS, &ref->count); in __percpu_ref_switch_to_percpu()
Dkstrtox.c374 int kstrtobool_from_user(const char __user *s, size_t count, bool *res) in kstrtobool_from_user() argument
379 count = min(count, sizeof(buf) - 1); in kstrtobool_from_user()
380 if (copy_from_user(buf, s, count)) in kstrtobool_from_user()
382 buf[count] = '\0'; in kstrtobool_from_user()
388 int f(const char __user *s, size_t count, unsigned int base, type *res) \
393 count = min(count, sizeof(buf) - 1); \
394 if (copy_from_user(buf, s, count)) \
396 buf[count] = '\0'; \
Drbtree_test.c165 int count; in black_path_count() local
166 for (count = 0; rb; rb = rb_parent(rb)) in black_path_count()
167 count += !is_red(rb); in black_path_count()
168 return count; in black_path_count()
174 int count = 0; in check_postorder_foreach() local
176 count++; in check_postorder_foreach()
178 WARN_ON_ONCE(count != nr_nodes); in check_postorder_foreach()
184 int count = 0; in check_postorder() local
186 count++; in check_postorder()
188 WARN_ON_ONCE(count != nr_nodes); in check_postorder()
[all …]
Dkobject_uevent.c62 static int kobject_action_type(const char *buf, size_t count, in kobject_action_type() argument
71 if (count && (buf[count-1] == '\n' || buf[count-1] == '\0')) in kobject_action_type()
72 count--; in kobject_action_type()
74 if (!count) in kobject_action_type()
77 args_start = strnchr(buf, count, ' '); in kobject_action_type()
82 count_first = count; in kobject_action_type()
114 static int kobject_action_args(const char *buf, size_t count, in kobject_action_args() argument
122 if (count && (buf[count - 1] == '\n' || buf[count - 1] == '\0')) in kobject_action_args()
123 count--; in kobject_action_args()
125 if (!count) in kobject_action_args()
[all …]
Diov_iter.c98 if (unlikely(i->count < n)) \
99 n = i->count; \
100 if (i->count) { \
133 i->count -= n; \
164 if (unlikely(bytes > i->count)) in copy_page_to_iter_iovec()
165 bytes = i->count; in copy_page_to_iter_iovec()
233 i->count -= wanted - bytes; in copy_page_to_iter_iovec()
248 if (unlikely(bytes > i->count)) in copy_page_from_iter_iovec()
249 bytes = i->count; in copy_page_from_iter_iovec()
317 i->count -= wanted - bytes; in copy_page_from_iter_iovec()
[all …]
Dlist_sort.c59 u8 count = 0; in merge_final() local
92 if (unlikely(!++count)) in merge_final()
193 size_t count = 0; /* Count of pending */ in list_sort() local
224 for (bits = count; bits & 1; bits >>= 1) in list_sort()
241 count++; in list_sort()
Dargv_split.c14 int count = 0; in count_argc() local
22 count++; in count_argc()
26 return count; in count_argc()
Dtest_kmod.c566 const char *buf, size_t count) in trigger_config_store() argument
593 ret = count; in trigger_config_store()
604 static int __kstrncpy(char **dst, const char *name, size_t count, gfp_t gfp) in __kstrncpy() argument
606 *dst = kstrndup(name, count, gfp); in __kstrncpy()
609 return count; in __kstrncpy()
614 size_t count) in config_copy_test_driver_name() argument
616 return __kstrncpy(&config->test_driver, name, count, GFP_KERNEL); in config_copy_test_driver_name()
621 size_t count) in config_copy_test_fs() argument
623 return __kstrncpy(&config->test_fs, name, count, GFP_KERNEL); in config_copy_test_fs()
654 const char *buf, size_t count) in config_test_driver_store() argument
[all …]
Dparman.c54 unsigned long count; member
128 unsigned long count) in __parman_prio_move() argument
130 parman->ops->move(parman->priv, item->index, to_index, count); in __parman_prio_move()
190 if (parman->count + 1 > parman->limit_count) { in parman_lsort_item_add()
204 parman->count++; in parman_lsort_item_add()
215 parman->count--; in parman_lsort_item_remove()
216 if (parman->limit_count - parman->count >= parman->ops->resize_step) in parman_lsort_item_remove()
Dtest_list_sort.c72 int i, count = 1, err = -ENOMEM; in list_sort_test() local
127 count++; in list_sort_test()
135 if (count != TEST_LIST_LEN) { in list_sort_test()
136 pr_err("error: bad list length %d", count); in list_sort_test()
/lib/zstd/
Dfse_compress.c262 int count = normalizedCounter[charnum++]; in FSE_writeNCount_generic() local
264 remaining -= count < 0 ? -count : count; in FSE_writeNCount_generic()
265 count++; /* +1 for extra accuracy */ in FSE_writeNCount_generic()
266 if (count >= threshold) in FSE_writeNCount_generic()
267 count += max; /* [0..max[ [max..threshold[ (...) [threshold+max 2*threshold[ */ in FSE_writeNCount_generic()
268 bitStream += count << bitCount; in FSE_writeNCount_generic()
270 bitCount -= (count < max); in FSE_writeNCount_generic()
271 previous0 = (count == 1); in FSE_writeNCount_generic()
324 size_t FSE_count_simple(unsigned *count, unsigned *maxSymbolValuePtr, const void *src, size_t srcSi… in FSE_count_simple() argument
331 memset(count, 0, (maxSymbolValue + 1) * sizeof(*count)); in FSE_count_simple()
[all …]
Dhuf_compress.c92 U32 *count; in HUF_compressWeights_wksp() local
100 count = (U32 *)workspace + spaceUsed32; in HUF_compressWeights_wksp()
116 CHECK_V_F(maxCount, FSE_count_simple(count, &maxSymbolValue, weightTable, wtSize)); in HUF_compressWeights_wksp()
124 CHECK_F(FSE_normalizeCount(norm, tableLog, count, wtSize, maxSymbolValue)); in HUF_compressWeights_wksp()
284 U32 count; member
341 U32 const highTotal = huffNode[highPos].count; in HUF_setMaxHeight()
342 U32 const lowTotal = 2 * huffNode[lowPos].count; in HUF_setMaxHeight()
389 static void HUF_sort(nodeElt *huffNode, const U32 *count, U32 maxSymbolValue) in HUF_sort() argument
396 U32 r = BIT_highbit32(count[n] + 1); in HUF_sort()
404 U32 const c = count[n]; in HUF_sort()
[all …]
Dentropy_common.c119 int count; in FSE_readNCount() local
122 count = bitStream & (threshold - 1); in FSE_readNCount()
125 count = bitStream & (2 * threshold - 1); in FSE_readNCount()
126 if (count >= threshold) in FSE_readNCount()
127 count -= max; in FSE_readNCount()
131 count--; /* extra accuracy */ in FSE_readNCount()
132 remaining -= count < 0 ? -count : count; /* -1 means +1 */ in FSE_readNCount()
133 normalizedCounter[charnum++] = (short)count; in FSE_readNCount()
134 previous0 = !count; in FSE_readNCount()
/lib/zlib_inflate/
Dinftrees.c44 unsigned short count[MAXBITS+1]; /* number of codes of each length */ in zlib_inflate_table() local
94 count[len] = 0; in zlib_inflate_table()
96 count[lens[sym]]++; in zlib_inflate_table()
101 if (count[max] != 0) break; in zlib_inflate_table()
113 if (count[min] != 0) break; in zlib_inflate_table()
120 left -= count[len]; in zlib_inflate_table()
129 offs[len + 1] = offs[len] + count[len]; in zlib_inflate_table()
240 if (--(count[len]) == 0) { in zlib_inflate_table()
258 left -= count[curr + drop]; in zlib_inflate_table()
/lib/reed_solomon/
Ddecode_rs.c24 int count = 0; variable
199 count = 0; /* Number of roots of lambda(x) */
217 root[count] = i;
218 loc[count] = k;
222 if (++count == deg_lambda)
225 if (deg_lambda != count) {
253 for (j = count - 1; j >= 0; j--) {
291 for (j = 0; j < count; j++) {
309 for (i = 0; i < count; i++) {
317 for (i = 0; i < count; i++) {

12