All of lore.kernel.org
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Jinseok Kim <always.starving0@gmail.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] power_management: rewrite runpwtests04.sh in C
Date: Sun, 24 May 2026 17:05:59 +0000	[thread overview]
Message-ID: <20260524170559.3969-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260524154221.2064-1-always.starving0@gmail.com>

Hi Jinseok,

On Mon, 25 May 2026 00:42:20 +0900, Jinseok Kim wrote:
> power_management: rewrite runpwtests04.sh in C

[...]

> +static void verify_cpuidle(unsigned int i)
> +{
> +	int fd;
> +	char path[PATH_MAX];
> +	char buf[32];
> +
> +	snprintf(path, sizeof(path), "%s/%s", CPUIDLE_PATH, tcases[i].name);
> +
> +	fd = SAFE_OPEN(path, O_RDONLY);

SAFE_OPEN() on a non-existent file aborts the test with TBROK.  The
files `current_governor_ro` and `current_driver` may not exist on every
system that has a cpuidle directory (e.g. no cpuidle driver loaded, or
kernel lacks CONFIG_CPU_IDLE_GOV_*).  Use open() directly and convert
ENOENT to TCONF:

    fd = open(path, O_RDONLY);
    if (fd < 0) {
        if (errno == ENOENT)
            tst_res(TCONF, "%s not available", path);
        else
            tst_res(TFAIL | TERRNO, "open(%s) failed", path);
        return;
    }

> +static struct tcases {
> +	const char *name;
> +} tcases[] = {

Tag and variable share the same name.  LTP convention uses the singular
for the struct tag: `struct tcase { ... } tcases[] = {`.

[...]

The new test is named `pwtests01` while the shell test it replaces was
`runpwtests04`.  The commit message does not explain the rename.  If
`pwtests01` is intentional (e.g. start of a new naming series), please
document it briefly.

---
Note:

Our agent completed the review of the patch. The full review can be
found at: https://github.com/linux-test-project/ltp/actions

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

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

  reply	other threads:[~2026-05-24 17:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-24 15:42 [LTP] [PATCH v2] power_management: rewrite runpwtests04.sh in C Jinseok Kim
2026-05-24 17:05 ` linuxtestproject.agent [this message]
2026-06-09  8:02 ` [LTP] " linuxtestproject.agent
2026-06-11  8:00 ` [LTP] [PATCH v2] " Andrea Cervesato via ltp
2026-06-12  9:17 ` Andrea Cervesato via ltp
  -- strict thread matches above, loose matches on Subject: below --
2026-06-12 17:13 [LTP] [PATCH v5] " Jinseok Kim
2026-06-12 19:09 ` [LTP] " linuxtestproject.agent
2026-06-12 12:20 [LTP] [PATCH v4] " Jinseok Kim
2026-06-12 16:22 ` [LTP] " linuxtestproject.agent
2026-05-16 20:00 [LTP] [PATCH] " Jinseok Kim
2026-05-17 17:13 ` [LTP] " linuxtestproject.agent

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=20260524170559.3969-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=always.starving0@gmail.com \
    --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.