2019-04-13 07:32:46

by Nicholas Mc Guire

[permalink] [raw]
Subject: [PATCH 0/4] ARM: imx legacy: cleanups

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


2019-04-13 07:30:19

by Nicholas Mc Guire

[permalink] [raw]
Subject: [PATCH 2/4] ARM: imx legacy: declare unsigned int rather than unsigned

provide the proper type for unsigned int.

Signed-off-by: Nicholas Mc Guire <[email protected]>
---

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

2019-04-13 07:30:57

by Nicholas Mc Guire

[permalink] [raw]
Subject: [PATCH 3/4 RFC] ARM: imx legacy: wrap complex macro in ()

Checkpatch suggests to place a parenthesis around this complex macro.

Signed-off-by: Nicholas Mc Guire <[email protected]>
---

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

2019-04-13 07:31:27

by Nicholas Mc Guire

[permalink] [raw]
Subject: [PATCH 1/4 RFC] ARM: imx legacy: warn on failed allocation

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 <[email protected]>
---

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

2019-04-13 07:33:26

by Nicholas Mc Guire

[permalink] [raw]
Subject: [PATCH 4/4] ARM: imx legacy: add an SPDX license identifier

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

Signed-off-by: Nicholas Mc Guire <[email protected]>
---
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 ([email protected])
--
2.1.4

2019-04-13 14:12:04

by Fabio Estevam

[permalink] [raw]
Subject: Re: [PATCH 4/4] ARM: imx legacy: add an SPDX license identifier

On Sat, Apr 13, 2019 at 4:30 AM Nicholas Mc Guire <[email protected]> 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 <[email protected]>
> ---
> 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.

2019-04-13 23:57:20

by Nicholas Mc Guire

[permalink] [raw]
Subject: Re: [PATCH 4/4] ARM: imx legacy: add an SPDX license identifier

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 <[email protected]> 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 <[email protected]>
> > ---
> > 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