All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Mike Rapoport <rppt@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>, Linux-MM <linux-mm@kvack.org>,
	Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [PATCH v2 5/5] tools/bootconfig: Define memblock_free_ptr() to fix build error
Date: Wed, 15 Sep 2021 12:00:17 +0900	[thread overview]
Message-ID: <20210915120017.a694a43cf7464b4010b39927@kernel.org> (raw)
In-Reply-To: <CAHk-=wg3bPXCmV3k6Znffnx=zZPFh+jcANujf8DZx6MsHLxS3g@mail.gmail.com>

On Tue, 14 Sep 2021 18:57:34 -0700
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Tue, Sep 14, 2021 at 6:47 PM Masami Hiramatsu <mhiramat@kernel.org> wrote:
> >
> > Hmm, OK. Let me copy lib/bootconfig.c itself into tools/bootconfig
> > as a user-space code.
> 
> Well, or we need to have some really good way to mark these shared files.
> 
> Normally I don't think we share any *.c files with tooling, and
> tooling copies over the *.h files it needs. Is this the only one?

What I need to share is lib/bootconfig.c and include/linux/bootconfig.h.
Those provides bootconfig APIs and parser.

But since bootconfig.c uses some kernel APIs, I made wrapper
header files. If I can add #ifdefs to split the parser and APIs
from those part (as you can see 90% of code doesn't need kernel
APIs), I think I don't need any wrappers to include the file
(instead of copying bootconfig.c).

> So yes, copying the *.c file in this case would match what we do for
> the header files, but particularly if there are others, maybe we could
> have something like the "uapi" directory that allows people to
> explicialy share files with the tools.

OK.

> But it would need to be very explicit in the pathname, so that people
> would have that big warning sign of "hey, now you're editing a file
> that is shared with tooling".
> 
> That has worked at least _somewhat_ with include/uapi/ and arch/*/include/uapi/.

Hmm, what about lib/uapi/bootconfig.c ?

Thank you,

> 
>          Linus


-- 
Masami Hiramatsu <mhiramat@kernel.org>

      reply	other threads:[~2021-09-15  3:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15  0:52 [PATCH v2 0/5] bootconfig: Fixes to bootconfig memory management Masami Hiramatsu
2021-09-15  0:53 ` [PATCH v2 1/5] bootconfig: Fix to check the xbc_node is used before free it Masami Hiramatsu
2021-09-15  1:12   ` Linus Torvalds
2021-09-15  1:12     ` Linus Torvalds
2021-09-15  1:44     ` Masami Hiramatsu
2021-09-15  0:53 ` [PATCH v2 2/5] bootconfig: init: Fix memblock leak in xbc_make_cmdline() Masami Hiramatsu
2021-09-15  0:53 ` [PATCH v2 3/5] bootconfig: init: Fix memblock leak in setup_boot_config() Masami Hiramatsu
2021-09-15  0:53 ` [PATCH v2 4/5] bootconfig: Free copied bootconfig data after boot Masami Hiramatsu
2021-09-15  1:13   ` Linus Torvalds
2021-09-15  1:13     ` Linus Torvalds
2021-09-15  1:45     ` Masami Hiramatsu
2021-09-15  0:53 ` [PATCH v2 5/5] tools/bootconfig: Define memblock_free_ptr() to fix build error Masami Hiramatsu
2021-09-15  1:21   ` Linus Torvalds
2021-09-15  1:21     ` Linus Torvalds
2021-09-15  1:47     ` Masami Hiramatsu
2021-09-15  1:57       ` Linus Torvalds
2021-09-15  1:57         ` Linus Torvalds
2021-09-15  3:00         ` Masami Hiramatsu [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=20210915120017.a694a43cf7464b4010b39927@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=rppt@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=vbabka@suse.cz \
    /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.