Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: "Ricardo B. Marlière" <rbm@suse.com>
Cc: Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v3 1/8] syscalls/mknod01: Fix checkpatch.pl warnings
Date: Tue, 22 Apr 2025 12:52:19 +0200	[thread overview]
Message-ID: <20250422105219.GA927374@pevik> (raw)
In-Reply-To: <20250414-conversions-mknod-v3-1-e08e7463bfaa@suse.com>

Hi Ricardo,

> Fix the following warnings:

> 	Alignment should match open parenthesis
> 	Please don't use multiple blank lines

I'm not sure how you invoke checkpatch.pl.
Could you please use LTP embedded version via:

$ make check-mknod01

Or, to see what it does use V=1

$ make check-mknod01 V=1

> Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
> ---
>  testcases/kernel/syscalls/mknod/mknod01.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

> diff --git a/testcases/kernel/syscalls/mknod/mknod01.c b/testcases/kernel/syscalls/mknod/mknod01.c
> index fe0a1cfa6a473f9c2b2a55493f830f13b86560a8..39e402ee412de39c7929dcae65fdf3e302de9b45 100644
> --- a/testcases/kernel/syscalls/mknod/mknod01.c
> +++ b/testcases/kernel/syscalls/mknod/mknod01.c
> @@ -26,7 +26,6 @@ static int tcases[] = {
>  	S_IFREG | 06700,
>  };

> -

This is not reported by our checkpatch.pl and it would be useful. I'm not sure
if you want to bother to look which from these --ignore
CONST_STRUCT,VOLATILE,SPLIT_STRING,FILE_PATH_CHANGES should be removed (or which
one is missing, maybe our checkpatch.pl is outdated).

>  static void run(unsigned int i)
>  {
>  	dev_t dev = 0;
> @@ -35,8 +34,8 @@ static void run(unsigned int i)
>  		dev = makedev(1, 3);

>  	TST_EXP_PASS(mknod(PATH, tcases[i], dev),
> -				"mknod(PATH, %o, %ld)",
> -				tcases[i], dev);
> +		     "mknod(PATH, %o, %ld)",
> +		     tcases[i], dev);

I'm not sure, if this is worth to fix (our checkpatch.pl setup does not report it).

But what would be worth to fix is 32 bit compatibility error on dev_t dev:

$ PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig CFLAGS=-m32 LDFLAGS=-m32 ./configure # see INSTALL
...

mknod01.c:37:22: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘dev_t’ {aka ‘long long unsigned int’} [-Wformat=]
   37 |                      "mknod(PATH, %o, %ld)",
      |                      ^~~~~~~~~~~~~~~~~~~~~~
../../../../include/tst_test_macros.h:42:32: note: in definition of macro ‘TST_FMT_’
   42 | #define TST_FMT_(FMT, _1, ...) FMT, ##__VA_ARGS__
      |                                ^~~
../../../../include/tst_test_macros.h:46:26: note: in expansion of macro ‘TST_2_’
   46 |                 TST_FMT_(TST_2_(dummy, ##__VA_ARGS__, SCALL) FMT, __VA_ARGS__))
      |                          ^~~~~~
../../../../include/tst_test_macros.h:210:25: note: in expansion of macro ‘TST_MSG_’
  210 |                         TST_MSG_(TPASS, " passed", #SCALL, ##__VA_ARGS__);     \
      |                         ^~~~~~~~
mknod01.c:36:9: note: in expansion of macro ‘TST_EXP_PASS’
   36 |         TST_EXP_PASS(mknod(PATH, tcases[i], dev),
      |         ^~~~~~~~~~~~
mknod01.c:37:41: note: format string is defined here
   37 |                      "mknod(PATH, %o, %ld)",
      |                                       ~~^
      |                                         |
      |                                         long int
      |                                       %lld

(It should be solved by PRIuMAX and casting to (uintmax_t), but we usually just
cast to (long long) and use just %lld. Whatever you prefer.

Kind regards,
Petr

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

  reply	other threads:[~2025-04-22 10:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14 20:09 [LTP] [PATCH v3 0/8] syscalls/mknod: Refactor all tests Ricardo B. Marlière via ltp
2025-04-14 20:09 ` [LTP] [PATCH v3 1/8] syscalls/mknod01: Fix checkpatch.pl warnings Ricardo B. Marlière via ltp
2025-04-22 10:52   ` Petr Vorel [this message]
2025-04-22 12:09     ` Ricardo B. Marlière via ltp
2025-04-14 20:09 ` [LTP] [PATCH v3 2/8] syscalls/mknod02: Use relative path to avoid use of SAFE_CHDIR Ricardo B. Marlière via ltp
2025-04-22 13:06   ` Petr Vorel
2025-05-15  2:49     ` Li Wang via ltp
2025-04-14 20:09 ` [LTP] [PATCH v3 3/8] syscalls/mknod03: Convert to new API Ricardo B. Marlière via ltp
2025-04-22 14:02   ` Petr Vorel
2025-04-22 14:32     ` Ricardo B. Marlière via ltp
2025-04-14 20:09 ` [LTP] [PATCH v3 4/8] syscalls/mknod04: " Ricardo B. Marlière via ltp
2025-04-22 14:06   ` Petr Vorel
2025-04-14 20:09 ` [LTP] [PATCH v3 5/8] syscalls/mknod05: " Ricardo B. Marlière via ltp
2025-04-25 15:30   ` Cyril Hrubis
2025-04-25 16:26     ` Ricardo B. Marlière via ltp
2025-04-14 20:09 ` [LTP] [PATCH v3 6/8] syscalls/mknod06: " Ricardo B. Marlière via ltp
2025-04-14 20:09 ` [LTP] [PATCH v3 7/8] syscalls/mknod07: " Ricardo B. Marlière via ltp
2025-04-14 20:09 ` [LTP] [PATCH v3 8/8] syscalls/mknod08: " Ricardo B. Marlière via ltp

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=20250422105219.GA927374@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=rbm@suse.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