All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@kernel.crashing.org>
To: yocto-patches@lists.yoctoproject.org
Subject: [pseudo][pseudo-1.9]PATCH 02/10] makewrappers: Don't generate unused _int paths with noignore_path
Date: Wed, 11 Nov 2026 10:15:04 -0600	[thread overview]
Message-ID: <1794413712-18072-3-git-send-email-mark.hatle@kernel.crashing.org> (raw)
In-Reply-To: <1794413712-18072-1-git-send-email-mark.hatle@kernel.crashing.org>

From: Mark Hatle <mark.hatle@amd.com>

With preserve_paths=1 the canonical path from pseudo_root_path() is
stored in <path>_int rather than overwriting the path argument. The
only reader of <path>_int is the ignore_paths() check, which is not
generated when noignore_path=1 is also set.

open_tree, open_tree_attr and openat2 set both options, so path_int was
assigned but never used, resulting in:

  warning: variable 'path_int' set but not used [-Wunused-but-set-variable]

It also meant an extra pseudo_root_path() call per invocation, as the
guts for these functions resolve the path themselves.

Skip the declaration and assignment of the _int paths when both options
are set. The generated code for all other wrappers is unchanged.

AI-Generated: Uses GitHub Copilot
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
(cherry picked from commit f86ca21137e8a846ba64e66243a54554be533c5e)
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
---
 makewrappers | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/makewrappers b/makewrappers
index 19508fa..4c99cf3 100755
--- a/makewrappers
+++ b/makewrappers
@@ -389,7 +389,8 @@ class Function:
         return self.args.call()
 
     def paths_decl(self):
-        if self.preserve_paths:
+        # path_int is only read by the ignore_paths() check
+        if self.preserve_paths and not self.noignore_path:
             return "\n\t".join("char *" + path + "_int;" for path in self.paths_to_munge)
         return ""
 
@@ -420,6 +421,9 @@ class Function:
                     "\t\t\t%s -1;\n"
                     "\t\t\tgoto quick_exit;\n"
                     "\t\t}\n" % (path, self.rc_assign()))
+            if self.preserve_paths and self.noignore_path:
+                # path_int is only read by the ignore_paths() check
+                continue
             fix_paths.append(
                 "%s = pseudo_root_path(__func__, __LINE__, %s%s, %s, %s);" %
                 (pathvar, prefix, self.dirfd, path, self.flags))
-- 
1.8.3.1


  parent reply	other threads:[~2026-11-11 16:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 16:15 [pseudo][pseudo-1.9]PATCH 00/10] Backports from master to 1.9 branch Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 01/10] test: Skip open_tree tests when the function or syscall is unavailable Mark Hatle
2026-11-11 16:15 ` Mark Hatle [this message]
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 03/10] ports/linux: Don't require <linux/mount.h> Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 04/10] configure: Require GCC 5 or later Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 05/10] pseudo_client: serialize path changes across clients Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 06/10] ports: hold the path lock in create and metadata wrappers Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 07/10] ports: check created files under the path lock before recording them Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 08/10] test-parallel-ops: Add a parallel create/rename/link/chmod test Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 09/10] README.security: Add information specific to file/process security Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 10/10] AGENTS.md: Add to assist future developers Mark Hatle
2026-11-12 11:46 ` [yocto-patches] [pseudo][pseudo-1.9]PATCH 00/10] Backports from master to 1.9 branch Yoann Congal

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=1794413712-18072-3-git-send-email-mark.hatle@kernel.crashing.org \
    --to=mark.hatle@kernel.crashing.org \
    --cc=yocto-patches@lists.yoctoproject.org \
    /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.