Home
last modified time | relevance | path

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

/linux/tools/testing/selftests/bpf/prog_tests/
H A Dsock_iter_batch.c14 int err, i, nread, to_read, total_read, iter_fd = -1; in do_test() local
62 nread = read(iter_fd, indices, onebyone ? sizeof(*indices) : to_read); in do_test()
63 if (nread <= 0 || nread % sizeof(*indices)) in do_test()
65 total_read += nread; in do_test()
69 for (i = 0; i < nread / sizeof(*indices); i++) in do_test()
72 ASSERT_EQ(nread, onebyone ? sizeof(*indices) : to_read, "nread"); in do_test()
83 nread = read(iter_fd, indices, onebyone ? sizeof(*indices) : to_read); in do_test()
84 if (nread <= 0 || nread % sizeof(*indices)) in do_test()
86 total_read += nread; in do_test()
88 for (i = 0; i < nread / sizeof(*indices); i++) in do_test()
[all …]
H A Dselect_reuseport.c392 ssize_t nread; in do_test() local
426 nread = recv(new_fd, &rcv_cmd, sizeof(rcv_cmd), MSG_DONTWAIT); in do_test()
427 RET_IF(nread != sizeof(rcv_cmd), in do_test()
430 ev.data.u32, nread, sizeof(rcv_cmd), errno); in do_test()
434 nread = recv(srv_fd, &rcv_cmd, sizeof(rcv_cmd), MSG_DONTWAIT); in do_test()
435 RET_IF(nread != sizeof(rcv_cmd), in do_test()
438 ev.data.u32, nread, sizeof(rcv_cmd), errno); in do_test()
H A Dtc_redirect.c1125 int direction, nread, nwrite; in tun_relay_loop() local
1137 nread = read(direction == SRC_TO_TARGET ? src_fd : target_fd, buf, sizeof(buf)); in tun_relay_loop()
1138 if (nread < 0) { in tun_relay_loop()
1143 nwrite = write(direction == SRC_TO_TARGET ? target_fd : src_fd, buf, nread); in tun_relay_loop()
1144 if (nwrite != nread) { in tun_relay_loop()
H A Dbtf.c5461 ssize_t nread; in do_test_pprint() local
5526 while ((nread = getline(&line, &line_len, pin_file)) > 0 && in do_test_pprint()
5530 if (CHECK(nread <= 0, "Unexpected EOF")) { in do_test_pprint()
5573 nread = getline(&line, &line_len, pin_file); in do_test_pprint()
5574 if (nread < 0) in do_test_pprint()
5592 nread = getline(&line, &line_len, pin_file); in do_test_pprint()
5593 if (nread < 0) in do_test_pprint()
5597 nread = getline(&line, &line_len, pin_file); in do_test_pprint()
5598 } while (++nr_read_elems < test->max_entries && nread > 0); in do_test_pprint()
5608 if (CHECK(nread > 0, "Unexpected extra pprint output: %s", line)) { in do_test_pprint()
/linux/arch/alpha/boot/tools/
H A Dmkbb.c92 int nread; in main() local
116 nread = read(fd, &bootloader_image, sizeof(bootblock)); in main()
117 if(nread != sizeof(bootblock)) { in main()
119 fprintf(stderr, "expected %zd, got %d\n", sizeof(bootblock), nread); in main()
124 nread = read(dev, &bootblock_from_disk, sizeof(bootblock)); in main()
125 if(nread != sizeof(bootblock)) { in main()
127 fprintf(stderr, "expected %zd, got %d\n", sizeof(bootblock), nread); in main()
/linux/scripts/kconfig/
H A Dpreprocess.c151 size_t nread; in do_shell() local
162 nread = fread(buf, 1, sizeof(buf), p); in do_shell()
163 if (nread == sizeof(buf)) in do_shell()
164 nread--; in do_shell()
167 while (nread > 0 && buf[nread - 1] == '\n') in do_shell()
168 nread--; in do_shell()
170 buf[nread] = 0; in do_shell()
173 for (i = 0; i < nread; i++) { in do_shell()
/linux/arch/mips/tools/
H A Delf-entry.c35 size_t nread; in main() local
51 nread = fread(&hdr, 1, sizeof(hdr), file); in main()
52 if (nread != sizeof(hdr)) { in main()
/linux/tools/testing/selftests/powerpc/tm/
H A Dtm-signal-pagefault.c89 ssize_t nread, offset; in fault_handler_thread() local
101 nread = read(uffd, &msg, sizeof(msg)); in fault_handler_thread()
102 if (nread == 0) { in fault_handler_thread()
107 if (nread == -1) { in fault_handler_thread()
/linux/tools/testing/vsock/
H A Dutil.c352 ssize_t nread = 0; in recv_buf() local
357 ret = recv(fd, buf + nread, len - nread, flags); in recv_buf()
363 nread += ret; in recv_buf()
364 } while (nread < len); in recv_buf()
385 if (nread != expected_ret) { in recv_buf()
390 nread, expected_ret); in recv_buf()
/linux/drivers/misc/c2port/
H A Dcore.c630 u8 status, nread = 128; in __c2port_read_flash_data() local
637 if (ops->block_size * ops->blocks_num - offset < nread) in __c2port_read_flash_data()
638 nread = ops->block_size * ops->blocks_num - offset; in __c2port_read_flash_data()
639 if (count < nread) in __c2port_read_flash_data()
640 nread = count; in __c2port_read_flash_data()
641 if (nread == 0) in __c2port_read_flash_data()
642 return nread; in __c2port_read_flash_data()
683 c2port_write_dr(dev, nread); in __c2port_read_flash_data()
703 for (i = 0; i < nread; i++) { in __c2port_read_flash_data()
713 return nread; in __c2port_read_flash_data()
/linux/drivers/infiniband/hw/hfi1/
H A Dpio_copy.c434 unsigned long nread; in mid_copy_mix() local
437 nread = 8 - pbuf->carry_bytes; in mid_copy_mix()
438 read_extra_bytes(pbuf, from, nread); in mid_copy_mix()
463 bytes_left -= nread; in mid_copy_mix()
464 from += nread; /* from is now not aligned */ in mid_copy_mix()
H A Dqsfp.c440 int nread; in qsfp_read() local
465 nread = len - count; in qsfp_read()
467 if (((addr % QSFP_RW_BOUNDARY) + nread) > QSFP_RW_BOUNDARY) in qsfp_read()
468 nread = QSFP_RW_BOUNDARY - (addr % QSFP_RW_BOUNDARY); in qsfp_read()
471 offset, bp + count, nread); in qsfp_read()
475 count += nread; in qsfp_read()
476 addr += nread; in qsfp_read()
/linux/drivers/i2c/busses/
H A Di2c-npcm7xx.c789 static void npcm_i2c_set_fifo(struct npcm_i2c *bus, int nread, int nwrite) in npcm_i2c_set_fifo() argument
800 if (nread > 0) { in npcm_i2c_set_fifo()
801 rxf_ctl = min_t(int, nread, bus->data->fifo_size); in npcm_i2c_set_fifo()
804 if (nread <= bus->data->fifo_size) in npcm_i2c_set_fifo()
970 static void npcm_i2c_slave_receive(struct npcm_i2c *bus, u16 nread, in npcm_i2c_slave_receive() argument
975 bus->slv_rd_size = nread; in npcm_i2c_slave_receive()
2037 u8 slave_addr, u16 nwrite, u16 nread, in npcm_i2c_master_start_xmit() argument
2050 bus->rd_size = nread; in npcm_i2c_master_start_xmit()
2055 if (nread) in npcm_i2c_master_start_xmit()
2059 if (nread && !nwrite) in npcm_i2c_master_start_xmit()
[all …]
/linux/drivers/usb/gadget/function/
H A Df_mass_storage.c615 ssize_t nread; in do_read() local
684 nread = kernel_read(curlun->filp, bh->buf, amount, in do_read()
687 (unsigned long long)file_offset, (int)nread); in do_read()
691 if (nread < 0) { in do_read()
692 LDBG(curlun, "error in file read: %d\n", (int)nread); in do_read()
693 nread = 0; in do_read()
694 } else if (nread < amount) { in do_read()
696 (int)nread, amount); in do_read()
697 nread = round_down(nread, curlun->blksize); in do_read()
699 file_offset += nread; in do_read()
[all …]
/linux/fs/vboxsf/
H A Dfile.c233 u32 nread = PAGE_SIZE; in vboxsf_read_folio() local
239 err = vboxsf_read(sf_handle->root, sf_handle->handle, off, &nread, buf); in vboxsf_read_folio()
240 buf = folio_zero_tail(folio, nread, buf + nread); in vboxsf_read_folio()
/linux/samples/cgroup/
H A Dmemcg_event_listener.c154 ssize_t nread; in read_memcg_events() local
157 nread = getline(&line, &len, fp); in read_memcg_events()
158 if (nread == -1) { in read_memcg_events()
/linux/drivers/comedi/drivers/
H A Ddt282x.c310 int nread; member
476 devpriv->nread -= nsamples; in dt282x_ai_dma_interrupt()
477 if (devpriv->nread < 0) { in dt282x_ai_dma_interrupt()
479 devpriv->nread = 0; in dt282x_ai_dma_interrupt()
481 if (!devpriv->nread) { in dt282x_ai_dma_interrupt()
517 if (devpriv->nread != 0) { in dt282x_interrupt()
711 devpriv->nread = devpriv->ntrig; in dt282x_ai_cmd()
892 devpriv->nread = devpriv->ntrig; in dt282x_ao_cmd()
/linux/tools/testing/selftests/hid/
H A Dhid_common.h324 int fd, nread; in match_sysfs_device() local
339 nread = read(fd, temp, ARRAY_SIZE(temp)); in match_sysfs_device()
340 if (nread > 0 && (strstr(temp, phys)) != NULL) in match_sysfs_device()
/linux/drivers/crypto/ccp/
H A Dsev-dev.c261 ssize_t nread; in sev_read_init_ex_file() local
285 nread = kernel_read(fp, sev_init_ex_buffer, NV_LENGTH, NULL); in sev_read_init_ex_file()
286 if (nread != NV_LENGTH) { in sev_read_init_ex_file()
289 NV_LENGTH, nread); in sev_read_init_ex_file()
292 dev_dbg(sev->dev, "SEV: read %ld bytes from NV file\n", nread); in sev_read_init_ex_file()
/linux/tools/perf/
H A Dbuiltin-daemon.c1365 ssize_t nread; in send_cmd() local
1386 while ((nread = getline(&line, &len, in)) != -1) { in send_cmd()
1387 if (fwrite(line, nread, 1, stdout) != 1) in send_cmd()
/linux/drivers/net/wireless/ath/ath9k/
H A Ddebug.c993 u8 nread; in read_file_dump_nfcal() local
1002 nread = AR_PHY_CCA_FILTERWINDOW_LENGTH - h[i].invalidNFcount; in read_file_dump_nfcal()
1003 seq_printf(file, " %d\t %d\t %d\t\t", i, h[i].privNF, nread); in read_file_dump_nfcal()
1004 for (j = 0; j < nread; j++) in read_file_dump_nfcal()
/linux/tools/testing/selftests/seccomp/
H A Dseccomp_bpf.c4472 ssize_t nread; in get_nth() local
4482 nread = getdelim(&line, &len, ' ', f); in get_nth()
4483 ASSERT_GE(nread, 0) { in get_nth()
4489 ASSERT_GT(nread, 0) { in get_nth()
4494 return nread - 1; in get_nth()
4601 ssize_t nread; in get_proc_syscall() local
4605 nread = get_nth(_metadata, proc_path, 1, &line); in get_proc_syscall()
4606 ASSERT_GT(nread, 0); in get_proc_syscall()
4608 if (!strncmp("running", line, MIN(7, nread))) in get_proc_syscall()
/linux/drivers/firmware/cirrus/
H A Dcs_dsp.c3455 int nread, i; in cs_dsp_chunk_read() local
3471 nread = min(ch->cachebits, nbits); in cs_dsp_chunk_read()
3472 nbits -= nread; in cs_dsp_chunk_read()
3474 result = ch->cache >> ((sizeof(ch->cache) * BITS_PER_BYTE) - nread); in cs_dsp_chunk_read()
3475 ch->cache <<= nread; in cs_dsp_chunk_read()
3476 ch->cachebits -= nread; in cs_dsp_chunk_read()
/linux/fs/btrfs/
H A Dctree.c1349 u64 nread = 0; in reada_for_search() local
1415 nread += blocksize; in reada_for_search()
1418 if (nread > nread_max || nscan > 32) in reada_for_search()
H A Dextent-tree.c5340 int nread = 0; in reada_walk_down() local
5355 if (nread >= wc->reada_count) in reada_walk_down()
5391 nread++; in reada_walk_down()