[PATCH v4 12/23] pinctrl: mediatek: Make use of PINCTRL_GROUP_DESC()

Andy Shevchenko posted 23 patches 2 years ago
There is a newer version of this series
[PATCH v4 12/23] pinctrl: mediatek: Make use of PINCTRL_GROUP_DESC()
Posted by Andy Shevchenko 2 years ago
Make use of PINCTRL_GROUP_DESC() instead of open coding it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/mediatek/pinctrl-moore.h | 7 +------
 drivers/pinctrl/mediatek/pinctrl-paris.h | 7 +------
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.h b/drivers/pinctrl/mediatek/pinctrl-moore.h
index e1b4b82b9d3d..22ef1ffbcdcb 100644
--- a/drivers/pinctrl/mediatek/pinctrl-moore.h
+++ b/drivers/pinctrl/mediatek/pinctrl-moore.h
@@ -38,12 +38,7 @@
 	}
 
 #define PINCTRL_PIN_GROUP(name, id)			\
-	{						\
-		name,					\
-		id##_pins,				\
-		ARRAY_SIZE(id##_pins),			\
-		id##_funcs,				\
-	}
+	PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
 
 int mtk_moore_pinctrl_probe(struct platform_device *pdev,
 			    const struct mtk_pin_soc *soc);
diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.h b/drivers/pinctrl/mediatek/pinctrl-paris.h
index 8762ac599329..f208a904c4a8 100644
--- a/drivers/pinctrl/mediatek/pinctrl-paris.h
+++ b/drivers/pinctrl/mediatek/pinctrl-paris.h
@@ -50,12 +50,7 @@
 	}
 
 #define PINCTRL_PIN_GROUP(name, id)			\
-	{						\
-		name,					\
-		id##_pins,				\
-		ARRAY_SIZE(id##_pins),			\
-		id##_funcs,				\
-	}
+	PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
 
 int mtk_paris_pinctrl_probe(struct platform_device *pdev);
 
-- 
2.43.0.rc1.1.gbec44491f096
Re: [PATCH v4 12/23] pinctrl: mediatek: Make use of PINCTRL_GROUP_DESC()
Posted by Marek Szyprowski 2 years ago
On 29.11.2023 17:06, Andy Shevchenko wrote:
> Make use of PINCTRL_GROUP_DESC() instead of open coding it.
>
> Signed-off-by: Andy Shevchenko<andriy.shevchenko@linux.intel.com>

This patch landed in linux-next as commit 1949e4630c3b ("pinctrl: 
mediatek: Make use of PINCTRL_GROUP_DESC()"). Unfortunately it causes a 
build break of ARM64 arch with standard defconfig.

> ---
>   drivers/pinctrl/mediatek/pinctrl-moore.h | 7 +------
>   drivers/pinctrl/mediatek/pinctrl-paris.h | 7 +------
>   2 files changed, 2 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.h b/drivers/pinctrl/mediatek/pinctrl-moore.h
> index e1b4b82b9d3d..22ef1ffbcdcb 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-moore.h
> +++ b/drivers/pinctrl/mediatek/pinctrl-moore.h
> @@ -38,12 +38,7 @@
>   	}
>   
>   #define PINCTRL_PIN_GROUP(name, id)			\
> -	{						\
> -		name,					\
> -		id##_pins,				\
> -		ARRAY_SIZE(id##_pins),			\
> -		id##_funcs,				\
> -	}
> +	PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
>   int mtk_moore_pinctrl_probe(struct platform_device *pdev,
>   			    const struct mtk_pin_soc *soc);
> diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.h b/drivers/pinctrl/mediatek/pinctrl-paris.h
> index 8762ac599329..f208a904c4a8 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-paris.h
> +++ b/drivers/pinctrl/mediatek/pinctrl-paris.h
> @@ -50,12 +50,7 @@
>   	}
>   
>   #define PINCTRL_PIN_GROUP(name, id)			\
> -	{						\
> -		name,					\
> -		id##_pins,				\
> -		ARRAY_SIZE(id##_pins),			\
> -		id##_funcs,				\
> -	}
> +	PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
>   
>   int mtk_paris_pinctrl_probe(struct platform_device *pdev);


PINCTRL_GROUP_DESC() macro from drivers/pinctrl/core.h contains a cast 
to (struct group_desc), what breaks users of the above macros.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland
Re: [PATCH v4 12/23] pinctrl: mediatek: Make use of PINCTRL_GROUP_DESC()
Posted by Andy Shevchenko 2 years ago
On Mon, Dec 04, 2023 at 12:40:38PM +0100, Marek Szyprowski wrote:
> On 29.11.2023 17:06, Andy Shevchenko wrote:
> > Make use of PINCTRL_GROUP_DESC() instead of open coding it.

> PINCTRL_GROUP_DESC() macro from drivers/pinctrl/core.h contains a cast
> to (struct group_desc), what breaks users of the above macros.

There is no cast (*).
Thanks for report, I will check.

But this was v4 of the series and LKP actually sent a positive feedback.
Besides that I have tested this locally with modules enabled.

*) It's a compound literal, _not_ a cast.
   Taking above into consideration I'm wondering what compilers
   are in use?

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v4 12/23] pinctrl: mediatek: Make use of PINCTRL_GROUP_DESC()
Posted by Krzysztof Kozlowski 2 years ago
On 04/12/2023 14:10, Andy Shevchenko wrote:
> On Mon, Dec 04, 2023 at 12:40:38PM +0100, Marek Szyprowski wrote:
>> On 29.11.2023 17:06, Andy Shevchenko wrote:
>>> Make use of PINCTRL_GROUP_DESC() instead of open coding it.
> 
>> PINCTRL_GROUP_DESC() macro from drivers/pinctrl/core.h contains a cast
>> to (struct group_desc), what breaks users of the above macros.
> 
> There is no cast (*).
> Thanks for report, I will check.
> 
> But this was v4 of the series and LKP actually sent a positive feedback.
> Besides that I have tested this locally with modules enabled.
> 
> *) It's a compound literal, _not_ a cast.
>    Taking above into consideration I'm wondering what compilers
>    are in use?

In my case: standard provided by Ubuntu 22.04, so: gcc version 11.4.0
(Ubuntu 11.4.0-1ubuntu1~22.04)


Best regards,
Krzysztof
Re: [PATCH v4 12/23] pinctrl: mediatek: Make use of PINCTRL_GROUP_DESC()
Posted by Krzysztof Kozlowski 2 years ago
On 04/12/2023 14:18, Krzysztof Kozlowski wrote:
> On 04/12/2023 14:10, Andy Shevchenko wrote:
>> On Mon, Dec 04, 2023 at 12:40:38PM +0100, Marek Szyprowski wrote:
>>> On 29.11.2023 17:06, Andy Shevchenko wrote:
>>>> Make use of PINCTRL_GROUP_DESC() instead of open coding it.
>>
>>> PINCTRL_GROUP_DESC() macro from drivers/pinctrl/core.h contains a cast
>>> to (struct group_desc), what breaks users of the above macros.
>>
>> There is no cast (*).
>> Thanks for report, I will check.
>>
>> But this was v4 of the series and LKP actually sent a positive feedback.
>> Besides that I have tested this locally with modules enabled.
>>
>> *) It's a compound literal, _not_ a cast.
>>    Taking above into consideration I'm wondering what compilers
>>    are in use?
> 
> In my case: standard provided by Ubuntu 22.04, so: gcc version 11.4.0
> (Ubuntu 11.4.0-1ubuntu1~22.04)

This was from my local machine. The ones used on the server are
mentioned in one of the steps:

https://krzk.eu/#/builders/5/builds/2532/steps/5/logs/property_changes

Best regards,
Krzysztof
Re: [PATCH v4 12/23] pinctrl: mediatek: Make use of PINCTRL_GROUP_DESC()
Posted by Geert Uytterhoeven 2 years ago
Hi Andy,

On Mon, Dec 4, 2023 at 2:10 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> On Mon, Dec 04, 2023 at 12:40:38PM +0100, Marek Szyprowski wrote:
> > On 29.11.2023 17:06, Andy Shevchenko wrote:
> > > Make use of PINCTRL_GROUP_DESC() instead of open coding it.
>
> > PINCTRL_GROUP_DESC() macro from drivers/pinctrl/core.h contains a cast
> > to (struct group_desc), what breaks users of the above macros.
>
> There is no cast (*).
> Thanks for report, I will check.
>
> But this was v4 of the series and LKP actually sent a positive feedback.
> Besides that I have tested this locally with modules enabled.
>
> *) It's a compound literal, _not_ a cast.
>    Taking above into consideration I'm wondering what compilers
>    are in use?

kisskb reported the following m68k failures to me:
    linux-next/m68k-allmodconfig/m68k-gcc8
    linux-next/m68k-allmodconfig/m68k-gcc11
    linux-next/m68k-allmodconfig/m68k-gcc12

However, according to [1], linux-next/m68k-allmodconfig/m68k-gcc13
did succeed, so I guess you are using gcc13?

[1] http://kisskb.ellerman.id.au/kisskb/head/629a3b49f3f957e975253c54846090b8d5ed2e9b/

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Re: [PATCH v4 12/23] pinctrl: mediatek: Make use of PINCTRL_GROUP_DESC()
Posted by Andy Shevchenko 2 years ago
On Mon, Dec 04, 2023 at 02:19:10PM +0100, Geert Uytterhoeven wrote:
> Hi Andy,
> 
> On Mon, Dec 4, 2023 at 2:10 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Mon, Dec 04, 2023 at 12:40:38PM +0100, Marek Szyprowski wrote:
> > > On 29.11.2023 17:06, Andy Shevchenko wrote:
> > > > Make use of PINCTRL_GROUP_DESC() instead of open coding it.
> >
> > > PINCTRL_GROUP_DESC() macro from drivers/pinctrl/core.h contains a cast
> > > to (struct group_desc), what breaks users of the above macros.
> >
> > There is no cast (*).
> > Thanks for report, I will check.
> >
> > But this was v4 of the series and LKP actually sent a positive feedback.
> > Besides that I have tested this locally with modules enabled.
> >
> > *) It's a compound literal, _not_ a cast.
> >    Taking above into consideration I'm wondering what compilers
> >    are in use?
> 
> kisskb reported the following m68k failures to me:
>     linux-next/m68k-allmodconfig/m68k-gcc8
>     linux-next/m68k-allmodconfig/m68k-gcc11
>     linux-next/m68k-allmodconfig/m68k-gcc12
> 
> However, according to [1], linux-next/m68k-allmodconfig/m68k-gcc13
> did succeed, so I guess you are using gcc13?

Yes, I compiled with these:

$ gcc --version
gcc (Debian 13.2.0-5) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ clang --version
Debian clang version 16.0.6 (16)
	Target: x86_64-pc-linux-gnu
	Thread model: posix
	InstalledDir: /usr/bin


-- 
With Best Regards,
Andy Shevchenko


Re: [PATCH v4 12/23] pinctrl: mediatek: Make use of PINCTRL_GROUP_DESC()
Posted by Geert Uytterhoeven 2 years ago
Hi Andy,

On Mon, Dec 4, 2023 at 2:32 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> On Mon, Dec 04, 2023 at 02:19:10PM +0100, Geert Uytterhoeven wrote:
> > On Mon, Dec 4, 2023 at 2:10 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > > On Mon, Dec 04, 2023 at 12:40:38PM +0100, Marek Szyprowski wrote:
> > > > On 29.11.2023 17:06, Andy Shevchenko wrote:
> > > > > Make use of PINCTRL_GROUP_DESC() instead of open coding it.
> > >
> > > > PINCTRL_GROUP_DESC() macro from drivers/pinctrl/core.h contains a cast
> > > > to (struct group_desc), what breaks users of the above macros.
> > >
> > > There is no cast (*).
> > > Thanks for report, I will check.
> > >
> > > But this was v4 of the series and LKP actually sent a positive feedback.
> > > Besides that I have tested this locally with modules enabled.
> > >
> > > *) It's a compound literal, _not_ a cast.
> > >    Taking above into consideration I'm wondering what compilers
> > >    are in use?
> >
> > kisskb reported the following m68k failures to me:
> >     linux-next/m68k-allmodconfig/m68k-gcc8
> >     linux-next/m68k-allmodconfig/m68k-gcc11
> >     linux-next/m68k-allmodconfig/m68k-gcc12
> >
> > However, according to [1], linux-next/m68k-allmodconfig/m68k-gcc13
> > did succeed, so I guess you are using gcc13?
>
> Yes, I compiled with these:
>
> $ gcc --version
> gcc (Debian 13.2.0-5) 13.2.0

Time to install and try an older version ;-)

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Re: [PATCH v4 12/23] pinctrl: mediatek: Make use of PINCTRL_GROUP_DESC()
Posted by Andy Shevchenko 2 years ago
On Mon, Dec 04, 2023 at 02:39:37PM +0100, Geert Uytterhoeven wrote:
> On Mon, Dec 4, 2023 at 2:32 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Mon, Dec 04, 2023 at 02:19:10PM +0100, Geert Uytterhoeven wrote:
> > > On Mon, Dec 4, 2023 at 2:10 PM Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:
> > > > On Mon, Dec 04, 2023 at 12:40:38PM +0100, Marek Szyprowski wrote:
> > > > > On 29.11.2023 17:06, Andy Shevchenko wrote:
> > > > > > Make use of PINCTRL_GROUP_DESC() instead of open coding it.
> > > >
> > > > > PINCTRL_GROUP_DESC() macro from drivers/pinctrl/core.h contains a cast
> > > > > to (struct group_desc), what breaks users of the above macros.
> > > >
> > > > There is no cast (*).
> > > > Thanks for report, I will check.
> > > >
> > > > But this was v4 of the series and LKP actually sent a positive feedback.
> > > > Besides that I have tested this locally with modules enabled.
> > > >
> > > > *) It's a compound literal, _not_ a cast.
> > > >    Taking above into consideration I'm wondering what compilers
> > > >    are in use?
> > >
> > > kisskb reported the following m68k failures to me:
> > >     linux-next/m68k-allmodconfig/m68k-gcc8
> > >     linux-next/m68k-allmodconfig/m68k-gcc11
> > >     linux-next/m68k-allmodconfig/m68k-gcc12
> > >
> > > However, according to [1], linux-next/m68k-allmodconfig/m68k-gcc13
> > > did succeed, so I guess you are using gcc13?
> >
> > Yes, I compiled with these:
> >
> > $ gcc --version
> > gcc (Debian 13.2.0-5) 13.2.0
> 
> Time to install and try an older version ;-)

Yeah, compound literals seems the often-to-break topic (as per GCC bugzilla).
Tried with GCC 8 for ARM64 and indeed it doesn't build it well.

-- 
With Best Regards,
Andy Shevchenko