public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Randolph Lin <randolph@andestech.com>
Cc: alankao@andestech.com, Mina <minachou@andestech.com>,
	kester.tw@gmail.com, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] syscalls: Fix tst_res() format string for 64-bit offset
Date: Tue, 20 Sep 2022 20:49:47 +0200	[thread overview]
Message-ID: <YyoLS/lLgCGRlmKg@pevik> (raw)
In-Reply-To: <20220920114358.2259862-1-randolph@andestech.com>

Hi Randolph,

> When compiling format string contains off_t type, to print off_t
> correctly is cast it to (long long int) type and change the format
> string to %lli.
LGTM, I'd just use %lld instead of %lli (it's exactly the same, but %lld is IMHO
more common.

Kind regards,
Petr

...
> +++ b/testcases/kernel/syscalls/lseek/lseek11.c
> @@ -159,7 +159,7 @@ static void setup(void)
>  	fd = SAFE_OPEN(fname, O_RDWR | O_CREAT, 0666);

>  	get_blocksize();
> -	tst_res(TINFO, "The block size is %lu", block_size);
> +	tst_res(TINFO, "The block size is %d", block_size);
This is wrong. While blksize_t is on aarch64 and riscv64 int, on 
most archs is long, thus this needs to have the same approach as the rest
(%lld and (long long int) cast.

with these 2 changes:

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2022-09-20 18:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-20 11:43 [LTP] [PATCH v2] syscalls: Fix tst_res() format string for 64-bit offset Randolph Lin
2022-09-20 18:49 ` Petr Vorel [this message]

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=YyoLS/lLgCGRlmKg@pevik \
    --to=pvorel@suse.cz \
    --cc=alankao@andestech.com \
    --cc=kester.tw@gmail.com \
    --cc=ltp@lists.linux.it \
    --cc=minachou@andestech.com \
    --cc=randolph@andestech.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox