seqbuf 18 drivers/firmware/tegra/bpmp-debugfs.c static void seqbuf_init(struct seqbuf *seqbuf, void *buf, size_t size) seqbuf 20 drivers/firmware/tegra/bpmp-debugfs.c seqbuf->buf = buf; seqbuf 21 drivers/firmware/tegra/bpmp-debugfs.c seqbuf->size = size; seqbuf 22 drivers/firmware/tegra/bpmp-debugfs.c seqbuf->pos = 0; seqbuf 25 drivers/firmware/tegra/bpmp-debugfs.c static size_t seqbuf_avail(struct seqbuf *seqbuf) seqbuf 27 drivers/firmware/tegra/bpmp-debugfs.c return seqbuf->pos < seqbuf->size ? seqbuf->size - seqbuf->pos : 0; seqbuf 30 drivers/firmware/tegra/bpmp-debugfs.c static size_t seqbuf_status(struct seqbuf *seqbuf) seqbuf 32 drivers/firmware/tegra/bpmp-debugfs.c return seqbuf->pos <= seqbuf->size ? 0 : -EOVERFLOW; seqbuf 35 drivers/firmware/tegra/bpmp-debugfs.c static int seqbuf_eof(struct seqbuf *seqbuf) seqbuf 37 drivers/firmware/tegra/bpmp-debugfs.c return seqbuf->pos >= seqbuf->size; seqbuf 40 drivers/firmware/tegra/bpmp-debugfs.c static int seqbuf_read(struct seqbuf *seqbuf, void *buf, size_t nbyte) seqbuf 42 drivers/firmware/tegra/bpmp-debugfs.c nbyte = min(nbyte, seqbuf_avail(seqbuf)); seqbuf 43 drivers/firmware/tegra/bpmp-debugfs.c memcpy(buf, seqbuf->buf + seqbuf->pos, nbyte); seqbuf 44 drivers/firmware/tegra/bpmp-debugfs.c seqbuf->pos += nbyte; seqbuf 45 drivers/firmware/tegra/bpmp-debugfs.c return seqbuf_status(seqbuf); seqbuf 48 drivers/firmware/tegra/bpmp-debugfs.c static int seqbuf_read_u32(struct seqbuf *seqbuf, uint32_t *v) seqbuf 52 drivers/firmware/tegra/bpmp-debugfs.c err = seqbuf_read(seqbuf, v, 4); seqbuf 57 drivers/firmware/tegra/bpmp-debugfs.c static int seqbuf_read_str(struct seqbuf *seqbuf, const char **str) seqbuf 59 drivers/firmware/tegra/bpmp-debugfs.c *str = seqbuf->buf + seqbuf->pos; seqbuf 60 drivers/firmware/tegra/bpmp-debugfs.c seqbuf->pos += strnlen(*str, seqbuf_avail(seqbuf)); seqbuf 61 drivers/firmware/tegra/bpmp-debugfs.c seqbuf->pos++; seqbuf 62 drivers/firmware/tegra/bpmp-debugfs.c return seqbuf_status(seqbuf); seqbuf 65 drivers/firmware/tegra/bpmp-debugfs.c static void seqbuf_seek(struct seqbuf *seqbuf, ssize_t offset) seqbuf 67 drivers/firmware/tegra/bpmp-debugfs.c seqbuf->pos += offset; seqbuf 301 drivers/firmware/tegra/bpmp-debugfs.c static int bpmp_populate_dir(struct tegra_bpmp *bpmp, struct seqbuf *seqbuf, seqbuf 309 drivers/firmware/tegra/bpmp-debugfs.c while (!seqbuf_eof(seqbuf)) { seqbuf 310 drivers/firmware/tegra/bpmp-debugfs.c err = seqbuf_read_u32(seqbuf, &d); seqbuf 315 drivers/firmware/tegra/bpmp-debugfs.c seqbuf_seek(seqbuf, -4); seqbuf 323 drivers/firmware/tegra/bpmp-debugfs.c err = seqbuf_read_u32(seqbuf, &t); seqbuf 326 drivers/firmware/tegra/bpmp-debugfs.c err = seqbuf_read_str(seqbuf, &name); seqbuf 334 drivers/firmware/tegra/bpmp-debugfs.c err = bpmp_populate_dir(bpmp, seqbuf, dentry, depth+1); seqbuf 356 drivers/firmware/tegra/bpmp-debugfs.c struct seqbuf seqbuf; seqbuf 363 drivers/firmware/tegra/bpmp-debugfs.c seqbuf_init(&seqbuf, buf, bufsize); seqbuf 364 drivers/firmware/tegra/bpmp-debugfs.c err = bpmp_populate_dir(bpmp, &seqbuf, bpmp->debugfs_mirror, 0);