Home
last modified time | relevance | path

Searched refs:ret (Results 1 – 25 of 388) sorted by relevance

12345678910>>...16

/tools/gpio/
Dgpio-utils.c70 int ret; in gpiotools_request_linehandle() local
72 ret = asprintf(&chrdev_name, "/dev/%s", device_name); in gpiotools_request_linehandle()
73 if (ret < 0) in gpiotools_request_linehandle()
78 ret = -errno; in gpiotools_request_linehandle()
92 ret = ioctl(fd, GPIO_GET_LINEHANDLE_IOCTL, &req); in gpiotools_request_linehandle()
93 if (ret == -1) { in gpiotools_request_linehandle()
94 ret = -errno; in gpiotools_request_linehandle()
96 ret); in gpiotools_request_linehandle()
103 return ret < 0 ? ret : req.fd; in gpiotools_request_linehandle()
116 int ret; in gpiotools_set_values() local
[all …]
Dgpio-event-mon.c39 int ret; in monitor_device() local
42 ret = asprintf(&chrdev_name, "/dev/%s", device_name); in monitor_device()
43 if (ret < 0) in monitor_device()
48 ret = -errno; in monitor_device()
58 ret = ioctl(fd, GPIO_GET_LINEEVENT_IOCTL, &req); in monitor_device()
59 if (ret == -1) { in monitor_device()
60 ret = -errno; in monitor_device()
63 ret); in monitor_device()
68 ret = ioctl(req.fd, GPIOHANDLE_GET_LINE_VALUES_IOCTL, &data); in monitor_device()
69 if (ret == -1) { in monitor_device()
[all …]
Dlsgpio.c77 int ret; in list_device() local
80 ret = asprintf(&chrdev_name, "/dev/%s", device_name); in list_device()
81 if (ret < 0) in list_device()
86 ret = -errno; in list_device()
92 ret = ioctl(fd, GPIO_GET_CHIPINFO_IOCTL, &cinfo); in list_device()
93 if (ret == -1) { in list_device()
94 ret = -errno; in list_device()
108 ret = ioctl(fd, GPIO_GET_LINEINFO_IOCTL, &linfo); in list_device()
109 if (ret == -1) { in list_device()
110 ret = -errno; in list_device()
[all …]
/tools/iio/
Diio_utils.c37 int i, ret; in iioutils_break_up_name() local
68 ret = asprintf(generic_name, "%s_%s", prefix, working); in iioutils_break_up_name()
71 return (ret == -1) ? -ENOMEM : 0; in iioutils_break_up_name()
94 int ret; in iioutils_get_type() local
101 ret = asprintf(&scan_el_dir, FORMAT_SCAN_ELEMENTS_DIR, device_dir); in iioutils_get_type()
102 if (ret < 0) in iioutils_get_type()
105 ret = asprintf(&builtname, FORMAT_TYPE_FILE, name); in iioutils_get_type()
106 if (ret < 0) { in iioutils_get_type()
107 ret = -ENOMEM; in iioutils_get_type()
110 ret = asprintf(&builtname_generic, FORMAT_TYPE_FILE, generic_name); in iioutils_get_type()
[all …]
Diio_generic_buffer.c210 int ret; in enable_disable_all_channels() local
223 ret = -ENOENT; in enable_disable_all_channels()
229 ret = write_sysfs_int(ent->d_name, scanelemdir, in enable_disable_all_channels()
231 if (ret < 0) in enable_disable_all_channels()
271 int ret; in cleanup() local
276 ret = write_sysfs_string("trigger/current_trigger", in cleanup()
278 if (ret < 0) in cleanup()
280 strerror(-ret)); in cleanup()
286 ret = write_sysfs_int("enable", buf_dir_name, 0); in cleanup()
287 if (ret < 0) in cleanup()
[all …]
Dlsiio.c65 int ret; in dump_one_device() local
67 ret = sscanf(dev_dir_name + strlen(iio_dir) + strlen(type_device), "%i", in dump_one_device()
69 if (ret != 1) in dump_one_device()
72 ret = read_sysfs_string("name", dev_dir_name, name); in dump_one_device()
73 if (ret < 0) in dump_one_device()
74 return ret; in dump_one_device()
88 int ret; in dump_one_trigger() local
90 ret = sscanf(dev_dir_name + strlen(iio_dir) + strlen(type_trigger), in dump_one_trigger()
92 if (ret != 1) in dump_one_trigger()
95 ret = read_sysfs_string("name", dev_dir_name, name); in dump_one_trigger()
[all …]
/tools/testing/selftests/timers/
Dset-2038.c51 int ret; in settime() local
56 ret = settimeofday(&now, NULL); in settime()
58 printf("Setting time to 0x%lx: %d\n", (long)time, ret); in settime()
59 return ret; in settime()
64 int ret; in do_tests() local
66 ret = system("date"); in do_tests()
67 ret = system("./inconsistency-check -c 0 -t 20"); in do_tests()
68 ret |= system("./nanosleep"); in do_tests()
69 ret |= system("./nsleep-lat"); in do_tests()
70 return ret; in do_tests()
[all …]
Dchange_skew.c39 int ret; in change_skew_test() local
44 ret = adjtimex(&tx); in change_skew_test()
45 if (ret < 0) { in change_skew_test()
47 return ret; in change_skew_test()
50 ret = system("./raw_skew"); in change_skew_test()
51 ret |= system("./inconsistency-check"); in change_skew_test()
52 ret |= system("./nanosleep"); in change_skew_test()
54 return ret; in change_skew_test()
61 int i, ret; in main() local
66 ret = system("killall -9 ntpd"); in main()
[all …]
/tools/perf/util/
Dtop.c31 size_t ret = 0; in perf_top__header_snprintf() local
47 ret = SNPRINTF(bf, size, in perf_top__header_snprintf()
56 ret = SNPRINTF(bf, size, in perf_top__header_snprintf()
75 ret += SNPRINTF(bf + ret, size - ret, "%" PRIu64 "%s ", in perf_top__header_snprintf()
80 ret += SNPRINTF(bf + ret, size - ret, "%s", perf_evsel__name(top->sym_evsel)); in perf_top__header_snprintf()
82 ret += SNPRINTF(bf + ret, size - ret, "], "); in perf_top__header_snprintf()
85 ret += SNPRINTF(bf + ret, size - ret, " (target_pid: %s", in perf_top__header_snprintf()
88 ret += SNPRINTF(bf + ret, size - ret, " (target_tid: %s", in perf_top__header_snprintf()
91 ret += SNPRINTF(bf + ret, size - ret, " (uid: %s", in perf_top__header_snprintf()
94 ret += SNPRINTF(bf + ret, size - ret, " (all"); in perf_top__header_snprintf()
[all …]
Dquote.c27 int ret; in sq_quote_buf() local
32 ret = strbuf_addch(dst, '\''); in sq_quote_buf()
33 while (!ret && *src) { in sq_quote_buf()
35 ret = strbuf_add(dst, src, len); in sq_quote_buf()
37 while (!ret && need_bs_quote(*src)) in sq_quote_buf()
38 ret = strbuf_addf(dst, "'\\%c\'", *src++); in sq_quote_buf()
40 if (!ret) in sq_quote_buf()
41 ret = strbuf_addch(dst, '\''); in sq_quote_buf()
44 return ret; in sq_quote_buf()
49 int i, ret; in sq_quote_argv() local
[all …]
Dprobe-file.c84 int ret; in open_trace_file() local
86 ret = e_snprintf(buf, PATH_MAX, "%s/%s", in open_trace_file()
88 if (ret >= 0) { in open_trace_file()
91 ret = open(buf, O_RDWR | O_APPEND, 0); in open_trace_file()
93 ret = open(buf, O_RDONLY, 0); in open_trace_file()
95 if (ret < 0) in open_trace_file()
96 ret = -errno; in open_trace_file()
98 return ret; in open_trace_file()
143 int ret, idx, fddup; in probe_file__get_rawlist() local
172 ret = strlist__add(sl, buf); in probe_file__get_rawlist()
[all …]
Dprobe-event.c64 int ret; in e_snprintf() local
67 ret = vsnprintf(str, size, format, ap); in e_snprintf()
69 if (ret >= (int)size) in e_snprintf()
70 ret = -E2BIG; in e_snprintf()
71 return ret; in e_snprintf()
79 int ret; in init_probe_symbol_maps() local
83 ret = symbol__init(NULL); in init_probe_symbol_maps()
84 if (ret < 0) { in init_probe_symbol_maps()
99 ret = -1; in init_probe_symbol_maps()
102 if (ret < 0) in init_probe_symbol_maps()
[all …]
/tools/testing/selftests/powerpc/ptrace/
Dptrace.h66 int ret; in start_trace() local
68 ret = ptrace(PTRACE_ATTACH, child, NULL, NULL); in start_trace()
69 if (ret) { in start_trace()
73 ret = waitpid(child, NULL, 0); in start_trace()
74 if (ret != child) { in start_trace()
83 int ret; in stop_trace() local
85 ret = ptrace(PTRACE_DETACH, child, NULL, NULL); in stop_trace()
86 if (ret) { in stop_trace()
95 int ret; in cont_trace() local
97 ret = ptrace(PTRACE_CONT, child, NULL, NULL); in cont_trace()
[all …]
/tools/testing/selftests/futex/functional/
Dfutex_requeue_pi.c57 int ret; member
77 int ret; in create_rt_thread() local
84 ret = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); in create_rt_thread()
85 if (ret) { in create_rt_thread()
86 error("pthread_attr_setinheritsched\n", ret); in create_rt_thread()
90 ret = pthread_attr_setschedpolicy(&attr, policy); in create_rt_thread()
91 if (ret) { in create_rt_thread()
92 error("pthread_attr_setschedpolicy\n", ret); in create_rt_thread()
97 ret = pthread_attr_setschedparam(&attr, &schedp); in create_rt_thread()
98 if (ret) { in create_rt_thread()
[all …]
Dfutex_requeue_pi_mismatched_ops.c60 int ret = RET_PASS; in main() local
87 ret = RET_ERROR; in main()
99 ret = futex_cmp_requeue_pi(&f1, f1, &f2, 1, 0, FUTEX_PRIVATE_FLAG); in main()
100 if (ret < 0) { in main()
107 ret = futex_wake(&f1, 1, FUTEX_PRIVATE_FLAG); in main()
108 if (ret == 1) { in main()
109 ret = RET_PASS; in main()
110 } else if (ret < 0) { in main()
112 ret = RET_ERROR; in main()
115 ret = RET_ERROR; in main()
[all …]
/tools/testing/selftests/seccomp/
Dseccomp_bpf.c170 long ret; in TEST() local
172 ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT, NULL, NULL, NULL); in TEST()
173 ASSERT_EQ(0, ret) { in TEST()
181 long ret; in TEST_SIGNAL() local
183 ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT, NULL, NULL, NULL); in TEST_SIGNAL()
184 ASSERT_EQ(0, ret) { in TEST_SIGNAL()
197 long ret; in TEST() local
199 ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); in TEST()
200 EXPECT_EQ(0, ret) { in TEST()
208 long ret; in TEST() local
[all …]
/tools/perf/jvmti/
Dlibjvmti.c17 static void print_error(jvmtiEnv *jvmti, const char *msg, jvmtiError ret) in print_error() argument
21 err = (*jvmti)->GetErrorName(jvmti, ret, &err_msg); in print_error()
26 warnx("%s failed with an unknown error %d", msg, ret); in print_error()
37 jvmtiError ret; in do_get_line_numbers() local
39 ret = (*jvmti)->GetLineNumberTable(jvmti, m, &nr_lines, &loc_tab); in do_get_line_numbers()
40 if (ret != JVMTI_ERROR_NONE) { in do_get_line_numbers()
41 print_error(jvmti, "GetLineNumberTable", ret); in do_get_line_numbers()
42 return ret; in do_get_line_numbers()
67 jint nr, ret; in get_line_numbers() local
86 ret = (*jvmti)->GetLineNumberTable(jvmti, c->methods[0], &nr, &lne); in get_line_numbers()
[all …]
/tools/perf/
Dbuiltin-probe.c68 int ret; in parse_probe_event() local
88 ret = parse_perf_probe_command(str, pev); in parse_probe_event()
91 return ret; in parse_probe_event()
97 int ret = 0; in params_add_filter() local
103 ret = err ? -EINVAL : -ENOMEM; in params_add_filter()
105 ret = strfilter__or(params.filter, str, &err); in params_add_filter()
107 if (ret == -EINVAL) { in params_add_filter()
113 return ret; in params_add_filter()
147 int i, len, ret, found_target; in parse_probe_event_argv() local
175 ret = parse_probe_event(buf); in parse_probe_event_argv()
[all …]
/tools/testing/selftests/gpio/
Dgpio-mockup-chardev.c40 int found = 0, ret; in get_debugfs() local
62 ret = asprintf(path, "%s/gpio", mnt_fs_get_target(fs)); in get_debugfs()
63 if (ret < 0) in get_debugfs()
131 static struct gpiochip_info *list_gpiochip(const char *gpiochip_name, int *ret) in list_gpiochip() argument
148 *ret = -errno; in list_gpiochip()
151 *ret = 0; in list_gpiochip()
156 *ret = asprintf(&chrdev_name, "/dev/%s", ent->d_name); in list_gpiochip()
157 if (*ret < 0) in list_gpiochip()
162 *ret = -errno; in list_gpiochip()
167 *ret = ioctl(fd, GPIO_GET_CHIPINFO_IOCTL, current); in list_gpiochip()
[all …]
/tools/perf/tests/
Dexpr.c22 int i, ret; in test__expr() local
30 ret = test(&ctx, "1+1", 2); in test__expr()
31 ret |= test(&ctx, "FOO+BAR", 3); in test__expr()
32 ret |= test(&ctx, "(BAR/2)%2", 1); in test__expr()
33 ret |= test(&ctx, "1 - -4", 5); in test__expr()
34 ret |= test(&ctx, "(FOO-1)*2 + (BAR/2)%2 - -4", 5); in test__expr()
35 ret |= test(&ctx, "1-1 | 1", 1); in test__expr()
36 ret |= test(&ctx, "1-1 & 1", 0); in test__expr()
37 ret |= test(&ctx, "min(1,2) + 1", 2); in test__expr()
38 ret |= test(&ctx, "max(1,2) + 1", 3); in test__expr()
[all …]
Devsel-tp-sched.c13 int ret = 0; in perf_evsel__test_field() local
24 ret = -1; in perf_evsel__test_field()
30 ret = -1; in perf_evsel__test_field()
33 return ret; in perf_evsel__test_field()
39 int ret = 0; in test__perf_evsel__tp_sched_test() local
47 ret = -1; in test__perf_evsel__tp_sched_test()
50 ret = -1; in test__perf_evsel__tp_sched_test()
53 ret = -1; in test__perf_evsel__tp_sched_test()
56 ret = -1; in test__perf_evsel__tp_sched_test()
59 ret = -1; in test__perf_evsel__tp_sched_test()
[all …]
/tools/power/cpupower/utils/
Dcpuidle-set.c29 int ret = 0, cont = 1, param = 0, disabled; in cmd_idle_set() local
35 ret = getopt_long(argc, argv, "d:e:ED:", info_opts, NULL); in cmd_idle_set()
36 if (ret == -1) in cmd_idle_set()
38 switch (ret) { in cmd_idle_set()
49 param = ret; in cmd_idle_set()
58 param = ret; in cmd_idle_set()
67 param = ret; in cmd_idle_set()
80 param = ret; in cmd_idle_set()
117 ret = cpuidle_state_disable(cpu, idlestate, 1); in cmd_idle_set()
118 if (ret == 0) in cmd_idle_set()
[all …]
/tools/cgroup/
Dcgroup_event_listener.c29 int ret; in main() local
38 ret = snprintf(event_control_path, PATH_MAX, "%s/cgroup.event_control", in main()
40 if (ret >= PATH_MAX) in main()
51 ret = snprintf(line, LINE_MAX, "%d %d %s", efd, cfd, argv[2]); in main()
52 if (ret >= LINE_MAX) in main()
55 ret = write(event_control, line, strlen(line) + 1); in main()
56 if (ret == -1) in main()
62 ret = read(efd, &result, sizeof(result)); in main()
63 if (ret == -1) { in main()
68 assert(ret == sizeof(result)); in main()
[all …]
/tools/perf/ui/stdio/
Dhist.c17 int ret = fprintf(fp, " "); in callchain__fprintf_left_margin() local
20 ret += fprintf(fp, " "); in callchain__fprintf_left_margin()
22 return ret; in callchain__fprintf_left_margin()
31 int ret = 0, i; in inline__fprintf() local
47 ret += callchain__fprintf_left_margin(fp, left_margin); in inline__fprintf()
51 ret += fprintf(fp, "|"); in inline__fprintf()
53 ret += fprintf(fp, " "); in inline__fprintf()
54 ret += fprintf(fp, " "); in inline__fprintf()
60 ret += fprintf(fp, "%s:%d (inline)", in inline__fprintf()
64 ret += fprintf(fp, "??"); in inline__fprintf()
[all …]
/tools/testing/selftests/powerpc/math/
Dfpu_syscall.c32 int ret; in syscall_fpu() local
36 ret = test_fpu(darray, &fork_pid); in syscall_fpu()
40 exit(ret); in syscall_fpu()
42 if (ret || child_ret) in syscall_fpu()
56 int ret; in test_syscall_fpu() local
66 child_ret = ret = 1; in test_syscall_fpu()
68 ret = syscall_fpu(); in test_syscall_fpu()
72 exit(ret); in test_syscall_fpu()
75 ret |= child_ret; in test_syscall_fpu()
80 exit(ret); in test_syscall_fpu()
[all …]

12345678910>>...16