mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Pei Xiao <xiaopei01@kylinos.cn>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	rafael@kernel.org, dakr@kernel.org,
	bartosz.golaszewski@linaro.org
Subject: Re: [PATCH] devres: Move remaining devm_alloc_percpu and devm_device_add_group to devres.h
Date: Wed, 28 May 2025 12:31:22 +0300	[thread overview]
Message-ID: <aDbX6natYH6Pu2ED@smile.fi.intel.com> (raw)
In-Reply-To: <2154e254-3cbc-4dc4-8497-f168fee58598@kylinos.cn>

On Wed, May 28, 2025 at 11:07:43AM +0800, Pei Xiao wrote:
> 
> 在 2025/5/27 19:09, Andy Shevchenko 写道:
> > On Tue, May 27, 2025 at 05:41:21PM +0800, Pei Xiao wrote:
> >> 在 2025/5/22 20:54, Andy Shevchenko 写道:
> >>> On Thu, May 22, 2025 at 05:01:26PM +0800, Pei Xiao wrote:

...

> >> include #include <asm/percpu.h>
> >>
> >> only move #include <asm/percpu.h> to linux/device/devres.h for
> >>
> >> build error.
> > It's not needed for the build error fixing as far as I understood it. __percpu
> > is defined in another header.
> 
> compiler_types.h or compiler.h 
> 
> I tried before send patch, but it all resulted in compilation failures on my arm64 machine.

You need to investigate those. But header doesn't use anything fancy AFAICS, so
compiler_types.h should be enough. I think you need to move asm/percpu.h to
devres.c (C file).

...

> >>>> +#include <linux/sysfs.h>
> >> it's redundant.
> >>>> +#include <asm/percpu.h>
> >>> What for are these new inclusions, please?
> >> for percpu.
> > It does not define __percpu.
> >
> >>>> +void devm_free_percpu(struct device *dev, void __percpu *pdata);
> >>> Please, take your time to understand what is behind the __percpu and
> >>> why the asm/percpu.h is redundant here.
> >> If this header file is missing, there will be a compilation error. 
> > Right. But this is wrong header for the purpose.
> >
> >> Which header file should I include?
> > The one that defines it, hint:
> > https://elixir.bootlin.com/linux/v6.15/A/ident/__percpu
> 
> compiler_types.h or compiler.h 
> 
> I tried before send patch, but it all resulted in compilation failures on my arm64 machine.
> 
>  You can give it a try.

Sure.

> when i add a error in compiler_types.h
> 
> +++ b/include/linux/compiler_types.h
> @@ -26,6 +26,7 @@
>  
>  /* sparse defines __CHECKER__; see Documentation/dev-tools/sparse.rst */
>  #ifdef __CHECKER__
> +sasasas
>  /* address spaces */
>  # define __kernel      __attribute__((address_space(0)))
>  # define __user                __attribute__((noderef, address_space(__user)
> 
> it  still build success,have no build error.
> 
> #include <linux/lockdep.h> include <asm/percpu.h> ,so have no build error before modidy,I think.
> 
> >> I've found that including <asm/percpu.h> does resolve my compilation issue.
> thanks!

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2025-05-28  9:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-22  9:01 Pei Xiao
2025-05-22 12:54 ` Andy Shevchenko
2025-05-23  3:08   ` Pei Xiao
2025-05-23 16:18     ` Andy Shevchenko
2025-05-27  9:41   ` Pei Xiao
2025-05-27 11:09     ` Andy Shevchenko
2025-05-28  3:07       ` Pei Xiao
2025-05-28  9:31         ` Andy Shevchenko [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=aDbX6natYH6Pu2ED@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=dakr@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=xiaopei01@kylinos.cn \
    /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

all inboxes | Powered by JetHome®