linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] ARM: imx legacy: cleanups
@ 2019-04-13  7:23 Nicholas Mc Guire
  2019-04-13  7:23 ` [PATCH 1/4 RFC] ARM: imx legacy: warn on failed allocation Nicholas Mc Guire
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Nicholas Mc Guire @ 2019-04-13  7:23 UTC (permalink / raw)
  To: Russell King
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Mark Brown, Linus Walleij, Tony Lindgren,
	Mike Rapoport, Janusz Krzysztofik, linux-arm-kernel,
	linux-kernel, Nicholas Mc Guire

Sorry for the noise - I accidentally sent out a set of old patches
along with this cleanups set. Only the ARM: imx legacy: should
have goon out.

While preparing a proposed fix for a missing check on zmalloc a few
other checkpatch warnings poped up - this little set fixes those
warnings. There is one remaining checkpatch warning but that looks
like a false-positive to me:

ERROR: Use of __initconst requires a separate use of const
#171: FILE: arch/arm/mach-imx/mach-mx27ads.c:171:
+mx27ads_nand_board_info __initconst = {

The false positive seems due to the definition spanning two lines
anyway looks good to me

<snip>
static const struct mxc_nand_platform_data
mx27ads_nand_board_info __initconst = {
        .width = 1,
        .hw_ecc = 1,
};
<snip>

thx!
hofrat

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/4 RFC] ARM: imx legacy: warn on failed allocation
  2019-04-13  7:23 [PATCH 0/4] ARM: imx legacy: cleanups Nicholas Mc Guire
@ 2019-04-13  7:23 ` Nicholas Mc Guire
  2019-04-13  7:23 ` [PATCH 2/4] ARM: imx legacy: declare unsigned int rather than unsigned Nicholas Mc Guire
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Nicholas Mc Guire @ 2019-04-13  7:23 UTC (permalink / raw)
  To: Russell King
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Mark Brown, Linus Walleij, Tony Lindgren,
	Mike Rapoport, Janusz Krzysztofik, linux-arm-kernel,
	linux-kernel, Nicholas Mc Guire

Even in init the allocation can fail and thus should at least warn so
that the cause can be identified.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

Problem located with an experimental coccinelle script

Note sure if there is a better solution as this is early in the boot
process so not that could be done anyway but fuss - anyway unchecked
allocation is not a good thing.

Patch was compile-tested with: imx_v4_v5_defconfig (implies
CONFIG_MACH_MX27ADS=y)
(with some unrelated sparse warnings about unimplemented syscalls
 and a few checkpatch warnings - covered in the other patches)

Patch is against 5.1-rc4 (localversion-next is 20190412)

 arch/arm/mach-imx/mach-mx27ads.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index 6dd7f57..528846f 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -247,6 +247,7 @@ static void __init mx27ads_regulator_init(void)
 	struct gpio_chip *vchip;
 
 	vchip = kzalloc(sizeof(*vchip), GFP_KERNEL);
+	WARN_ON(!vchip);
 	vchip->owner		= THIS_MODULE;
 	vchip->label		= "LCD";
 	vchip->base		= MX27ADS_LCD_GPIO;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/4] ARM: imx legacy: declare unsigned int rather than unsigned
  2019-04-13  7:23 [PATCH 0/4] ARM: imx legacy: cleanups Nicholas Mc Guire
  2019-04-13  7:23 ` [PATCH 1/4 RFC] ARM: imx legacy: warn on failed allocation Nicholas Mc Guire
@ 2019-04-13  7:23 ` Nicholas Mc Guire
  2019-04-13  7:23 ` [PATCH 3/4 RFC] ARM: imx legacy: wrap complex macro in () Nicholas Mc Guire
  2019-04-13  7:23 ` [PATCH 4/4] ARM: imx legacy: add an SPDX license identifier Nicholas Mc Guire
  3 siblings, 0 replies; 8+ messages in thread
From: Nicholas Mc Guire @ 2019-04-13  7:23 UTC (permalink / raw)
  To: Russell King
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Mark Brown, Linus Walleij, Tony Lindgren,
	Mike Rapoport, Janusz Krzysztofik, linux-arm-kernel,
	linux-kernel, Nicholas Mc Guire

provide the proper type for unsigned int.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

Problem reported by checkpatch

Patch was compile-tested with: imx_v4_v5_defconfig (implies
CONFIG_MACH_MX27ADS=y)

Patch is against 5.1-rc4 (localversion-next is 20190412)

 arch/arm/mach-imx/mach-mx27ads.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index 528846f..49ac898 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -202,7 +202,7 @@ static const struct imxi2c_platform_data mx27ads_i2c1_data __initconst = {
 static struct i2c_board_info mx27ads_i2c_devices[] = {
 };
 
-static void vgpio_set(struct gpio_chip *chip, unsigned offset, int value)
+static void vgpio_set(struct gpio_chip *chip, unsigned int offset, int value)
 {
 	if (value)
 		imx_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_SET_REG);
@@ -210,7 +210,7 @@ static void vgpio_set(struct gpio_chip *chip, unsigned offset, int value)
 		imx_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_CLEAR_REG);
 }
 
-static int vgpio_dir_out(struct gpio_chip *chip, unsigned offset, int value)
+static int vgpio_dir_out(struct gpio_chip *chip, unsigned int offset, int value)
 {
 	return 0;
 }
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/4 RFC] ARM: imx legacy: wrap complex macro in ()
  2019-04-13  7:23 [PATCH 0/4] ARM: imx legacy: cleanups Nicholas Mc Guire
  2019-04-13  7:23 ` [PATCH 1/4 RFC] ARM: imx legacy: warn on failed allocation Nicholas Mc Guire
  2019-04-13  7:23 ` [PATCH 2/4] ARM: imx legacy: declare unsigned int rather than unsigned Nicholas Mc Guire
@ 2019-04-13  7:23 ` Nicholas Mc Guire
  2019-04-13  7:23 ` [PATCH 4/4] ARM: imx legacy: add an SPDX license identifier Nicholas Mc Guire
  3 siblings, 0 replies; 8+ messages in thread
From: Nicholas Mc Guire @ 2019-04-13  7:23 UTC (permalink / raw)
  To: Russell King
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Mark Brown, Linus Walleij, Tony Lindgren,
	Mike Rapoport, Janusz Krzysztofik, linux-arm-kernel,
	linux-kernel, Nicholas Mc Guire

Checkpatch suggests to place a parenthesis around this complex macro.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

Problem reported by checkpatch

I'm actually not sure this really is improving readability but by
default checkpatch gets it right so...

Patch was compile-tested with: imx_v4_v5_defconfig (implies
CONFIG_MACH_MX27ADS=y)

Patch is against 5.1-rc4 (localversion-next is 20190412)

 arch/arm/mach-imx/mach-mx27ads.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index 49ac898..c83fdd3 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -42,8 +42,8 @@
  * Base address of PBC controller, CS4
  */
 #define PBC_BASE_ADDRESS        0xf4300000
-#define PBC_REG_ADDR(offset)    (void __force __iomem *) \
-		(PBC_BASE_ADDRESS + (offset))
+#define PBC_REG_ADDR(offset)    ((void __force __iomem *) \
+		(PBC_BASE_ADDRESS + (offset)))
 
 /* When the PBC address connection is fixed in h/w, defined as 1 */
 #define PBC_ADDR_SH             0
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/4] ARM: imx legacy: add an SPDX license identifier
  2019-04-13  7:23 [PATCH 0/4] ARM: imx legacy: cleanups Nicholas Mc Guire
                   ` (2 preceding siblings ...)
  2019-04-13  7:23 ` [PATCH 3/4 RFC] ARM: imx legacy: wrap complex macro in () Nicholas Mc Guire
@ 2019-04-13  7:23 ` Nicholas Mc Guire
  2019-04-13 14:11   ` Fabio Estevam
  3 siblings, 1 reply; 8+ messages in thread
From: Nicholas Mc Guire @ 2019-04-13  7:23 UTC (permalink / raw)
  To: Russell King
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Mark Brown, Linus Walleij, Tony Lindgren,
	Mike Rapoport, Janusz Krzysztofik, linux-arm-kernel,
	linux-kernel, Nicholas Mc Guire

The header clearly identifies this code as GPL V2 or later - so pop
in the SPDX license identifier.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---
 arch/arm/mach-imx/mach-mx27ads.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index c83fdd3..3f68972 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  Copyright (C) 2000 Deep Blue Solutions Ltd
  *  Copyright (C) 2002 Shane Nay (shane@minirl.com)
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/4] ARM: imx legacy: add an SPDX license identifier
  2019-04-13  7:23 ` [PATCH 4/4] ARM: imx legacy: add an SPDX license identifier Nicholas Mc Guire
@ 2019-04-13 14:11   ` Fabio Estevam
  2019-04-13 23:54     ` Nicholas Mc Guire
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2019-04-13 14:11 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: Russell King, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	NXP Linux Team, Mark Brown, Linus Walleij, Tony Lindgren,
	Mike Rapoport, Janusz Krzysztofik,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-kernel

On Sat, Apr 13, 2019 at 4:30 AM Nicholas Mc Guire <hofrat@osadl.org> wrote:
>
> The header clearly identifies this code as GPL V2 or later - so pop
> in the SPDX license identifier.
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
>  arch/arm/mach-imx/mach-mx27ads.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
> index c83fdd3..3f68972 100644
> --- a/arch/arm/mach-imx/mach-mx27ads.c
> +++ b/arch/arm/mach-imx/mach-mx27ads.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0+

As you are adding the SPDX line you could also remove the legal text below.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/4] ARM: imx legacy: add an SPDX license identifier
  2019-04-13 14:11   ` Fabio Estevam
@ 2019-04-13 23:54     ` Nicholas Mc Guire
  0 siblings, 0 replies; 8+ messages in thread
From: Nicholas Mc Guire @ 2019-04-13 23:54 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Nicholas Mc Guire, Russell King, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, NXP Linux Team, Mark Brown,
	Linus Walleij, Tony Lindgren, Mike Rapoport, Janusz Krzysztofik,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-kernel

On Sat, Apr 13, 2019 at 11:11:05AM -0300, Fabio Estevam wrote:
> On Sat, Apr 13, 2019 at 4:30 AM Nicholas Mc Guire <hofrat@osadl.org> wrote:
> >
> > The header clearly identifies this code as GPL V2 or later - so pop
> > in the SPDX license identifier.
> >
> > Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> > ---
> >  arch/arm/mach-imx/mach-mx27ads.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
> > index c83fdd3..3f68972 100644
> > --- a/arch/arm/mach-imx/mach-mx27ads.c
> > +++ b/arch/arm/mach-imx/mach-mx27ads.c
> > @@ -1,3 +1,4 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> 
> As you are adding the SPDX line you could also remove the legal text below.

hmmm - as I'm not the copyright holder I do not think I should
be doing that - it has more information in it that only GPL V2+

thx!
hofrat

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/4] ARM: imx legacy: add an SPDX license identifier
  2019-04-13  7:14 [PATCH 0/4] ARM: imx legacy: cleanups Nicholas Mc Guire
@ 2019-04-13  7:14 ` Nicholas Mc Guire
  0 siblings, 0 replies; 8+ messages in thread
From: Nicholas Mc Guire @ 2019-04-13  7:14 UTC (permalink / raw)
  To: Russell King
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Mark Brown, Linus Walleij, Tony Lindgren,
	Mike Rapoport, Janusz Krzysztofik, linux-arm-kernel,
	linux-kernel, Nicholas Mc Guire

The header clearly identifies this code as GPL V2 or later - so pop
in the SPDX license identifier.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---
 arch/arm/mach-imx/mach-mx27ads.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index c83fdd3..3f68972 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  Copyright (C) 2000 Deep Blue Solutions Ltd
  *  Copyright (C) 2002 Shane Nay (shane@minirl.com)
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-04-13 23:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-13  7:23 [PATCH 0/4] ARM: imx legacy: cleanups Nicholas Mc Guire
2019-04-13  7:23 ` [PATCH 1/4 RFC] ARM: imx legacy: warn on failed allocation Nicholas Mc Guire
2019-04-13  7:23 ` [PATCH 2/4] ARM: imx legacy: declare unsigned int rather than unsigned Nicholas Mc Guire
2019-04-13  7:23 ` [PATCH 3/4 RFC] ARM: imx legacy: wrap complex macro in () Nicholas Mc Guire
2019-04-13  7:23 ` [PATCH 4/4] ARM: imx legacy: add an SPDX license identifier Nicholas Mc Guire
2019-04-13 14:11   ` Fabio Estevam
2019-04-13 23:54     ` Nicholas Mc Guire
  -- strict thread matches above, loose matches on Subject: below --
2019-04-13  7:14 [PATCH 0/4] ARM: imx legacy: cleanups Nicholas Mc Guire
2019-04-13  7:14 ` [PATCH 4/4] ARM: imx legacy: add an SPDX license identifier Nicholas Mc Guire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).