Lines Matching refs:len
38 size_t len; in sysctl_test_api_dointvec_null_tbl_data() local
45 len = 1234; in sysctl_test_api_dointvec_null_tbl_data()
47 KUNIT_PROC_READ, buffer, &len, in sysctl_test_api_dointvec_null_tbl_data()
49 KUNIT_EXPECT_EQ(test, 0, len); in sysctl_test_api_dointvec_null_tbl_data()
54 len = 1234; in sysctl_test_api_dointvec_null_tbl_data()
56 KUNIT_PROC_WRITE, buffer, &len, in sysctl_test_api_dointvec_null_tbl_data()
58 KUNIT_EXPECT_EQ(test, 0, len); in sysctl_test_api_dointvec_null_tbl_data()
84 size_t len; in sysctl_test_api_dointvec_table_maxlen_unset() local
91 len = 1234; in sysctl_test_api_dointvec_table_maxlen_unset()
93 KUNIT_PROC_READ, buffer, &len, in sysctl_test_api_dointvec_table_maxlen_unset()
95 KUNIT_EXPECT_EQ(test, 0, len); in sysctl_test_api_dointvec_table_maxlen_unset()
100 len = 1234; in sysctl_test_api_dointvec_table_maxlen_unset()
102 KUNIT_PROC_WRITE, buffer, &len, in sysctl_test_api_dointvec_table_maxlen_unset()
104 KUNIT_EXPECT_EQ(test, 0, len); in sysctl_test_api_dointvec_table_maxlen_unset()
130 size_t len = 0; in sysctl_test_api_dointvec_table_len_is_zero() local
134 &len, &pos)); in sysctl_test_api_dointvec_table_len_is_zero()
135 KUNIT_EXPECT_EQ(test, 0, len); in sysctl_test_api_dointvec_table_len_is_zero()
138 &len, &pos)); in sysctl_test_api_dointvec_table_len_is_zero()
139 KUNIT_EXPECT_EQ(test, 0, len); in sysctl_test_api_dointvec_table_len_is_zero()
165 size_t len = 1234; in sysctl_test_api_dointvec_table_read_but_position_set() local
173 &len, &pos)); in sysctl_test_api_dointvec_table_read_but_position_set()
174 KUNIT_EXPECT_EQ(test, 0, len); in sysctl_test_api_dointvec_table_read_but_position_set()
194 size_t len = 4; in sysctl_test_dointvec_read_happy_single_positive() local
196 char *buffer = kunit_kzalloc(test, len, GFP_USER); in sysctl_test_dointvec_read_happy_single_positive()
202 user_buffer, &len, &pos)); in sysctl_test_dointvec_read_happy_single_positive()
203 KUNIT_ASSERT_EQ(test, 3, len); in sysctl_test_dointvec_read_happy_single_positive()
204 buffer[len] = '\0'; in sysctl_test_dointvec_read_happy_single_positive()
225 size_t len = 5; in sysctl_test_dointvec_read_happy_single_negative() local
227 char *buffer = kunit_kzalloc(test, len, GFP_USER); in sysctl_test_dointvec_read_happy_single_negative()
232 user_buffer, &len, &pos)); in sysctl_test_dointvec_read_happy_single_negative()
233 KUNIT_ASSERT_EQ(test, 4, len); in sysctl_test_dointvec_read_happy_single_negative()
234 buffer[len] = '\0'; in sysctl_test_dointvec_read_happy_single_negative()
255 size_t len = sizeof(input) - 1; in sysctl_test_dointvec_write_happy_single_positive() local
257 char *buffer = kunit_kzalloc(test, len, GFP_USER); in sysctl_test_dointvec_write_happy_single_positive()
260 memcpy(buffer, input, len); in sysctl_test_dointvec_write_happy_single_positive()
263 user_buffer, &len, &pos)); in sysctl_test_dointvec_write_happy_single_positive()
264 KUNIT_EXPECT_EQ(test, sizeof(input) - 1, len); in sysctl_test_dointvec_write_happy_single_positive()
285 size_t len = sizeof(input) - 1; in sysctl_test_dointvec_write_happy_single_negative() local
287 char *buffer = kunit_kzalloc(test, len, GFP_USER); in sysctl_test_dointvec_write_happy_single_negative()
290 memcpy(buffer, input, len); in sysctl_test_dointvec_write_happy_single_negative()
293 user_buffer, &len, &pos)); in sysctl_test_dointvec_write_happy_single_negative()
294 KUNIT_EXPECT_EQ(test, sizeof(input) - 1, len); in sysctl_test_dointvec_write_happy_single_negative()
316 size_t max_len = 32, len = max_len; in sysctl_test_api_dointvec_write_single_less_int_min() local
333 user_buffer, &len, &pos)); in sysctl_test_api_dointvec_write_single_less_int_min()
334 KUNIT_EXPECT_EQ(test, max_len, len); in sysctl_test_api_dointvec_write_single_less_int_min()
354 size_t max_len = 32, len = max_len; in sysctl_test_api_dointvec_write_single_greater_int_max() local
365 user_buffer, &len, &pos)); in sysctl_test_api_dointvec_write_single_greater_int_max()
366 KUNIT_ASSERT_EQ(test, max_len, len); in sysctl_test_api_dointvec_write_single_greater_int_max()