All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/pread01: Convert to new API
Date: Wed, 1 Sep 2021 15:53:30 +0200	[thread overview]
Message-ID: <YS+F2vm0SVSLvyjU@pevik> (raw)
In-Reply-To: <YS998a/fPdH5aZh8@pevik>

Hi Dai,

> ...
> > +static void verify_pwrite(void)
...

> your code:
> static void verify_pread(void)
> {
> 	SAFE_PREAD(1, fildes, read_buf[2], K1, K2);

> 	l_seek(fildes, 0, SEEK_CUR, K4);

> 	l_seek(fildes, 0, SEEK_SET, 0);

> 	SAFE_PREAD(1, fildes, read_buf[3], K1, K3);

> 	l_seek(fildes, 0, SEEK_CUR, 0);

> 	SAFE_READ(1, fildes, read_buf[0], K1);

> 	l_seek(fildes, 0, SEEK_CUR, K1);

> 	SAFE_PREAD(1, fildes, read_buf[1], K1, K1);

> 	l_seek(fildes, 0, SEEK_CUR, K1);

> 	compare_bufers();

> 	l_seek(fildes, K4, SEEK_SET, K4);
> }

> nit: having blank line after each line?

> how about something like:

> static void verify_pread(void)
> {
> 	SAFE_PREAD(1, fildes, read_buf[2], K1, K2);
> 	l_seek(fildes, 0, SEEK_CUR, K4);
> 	l_seek(fildes, 0, SEEK_SET, 0);

> 	SAFE_PREAD(1, fildes, read_buf[3], K1, K3);
> 	l_seek(fildes, 0, SEEK_CUR, 0);

> 	SAFE_READ(1, fildes, read_buf[0], K1);
> 	l_seek(fildes, 0, SEEK_CUR, K1);

> 	SAFE_PREAD(1, fildes, read_buf[1], K1, K1);
> 	l_seek(fildes, 0, SEEK_CUR, K1);

> 	compare_bufers();

> 	l_seek(fildes, K4, SEEK_SET, K4);
> }

I'm sorry, this was meant to be mentioned at patch, which changes pread01.c [1],
not here. I got confused by your wrong subject. But most of the code is similar,
thus can apply here.

[1] https://patchwork.ozlabs.org/project/ltp/patch/1629200697-14878-1-git-send-email-daisl.fnst@fujitsu.com/

> The rest LGTM.

> Kind regards,
> Petr

  reply	other threads:[~2021-09-01 13:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 13:50 [LTP] [PATCH] syscalls/pread01: Convert to new API Dai Shili
2021-09-01 13:19 ` Petr Vorel
2021-09-01 13:53   ` Petr Vorel [this message]
2021-09-01 13:48 ` Petr Vorel
2021-09-01 14:08 ` Petr Vorel
2021-09-02  1:17   ` xuyang2018.jy
2021-09-02 16:58     ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YS+F2vm0SVSLvyjU@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.