2014-02-07 08:00:14

by Jingoo Han

[permalink] [raw]
Subject: [PATCH 00/10] rtc: Remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message. For example,
k.alloc and v.alloc failures use dump_stack().

Jingoo Han (10):
rtc: rtc-at32ap700x: Remove unnecessary OOM messages
rtc: rtc-davinci: Remove unnecessary OOM messages
rtc: rtc-ds1390: Remove unnecessary OOM messages
rtc: rtc-lpc32xx: Remove unnecessary OOM messages
rtc: rtc-moxart: Remove unnecessary OOM messages
rtc: rtc-nuc900: Remove unnecessary OOM messages
rtc: rtc-pm8xxx: Remove unnecessary OOM messages
rtc: rtc-rx8025: Remove unnecessary OOM messages
rtc: rtc-sirfsoc: Remove unnecessary OOM messages
rtc: rtc-spear: Remove unnecessary OOM messages
---
drivers/rtc/rtc-at32ap700x.c | 4 +---
drivers/rtc/rtc-davinci.c | 4 +---
drivers/rtc/rtc-ds1390.c | 5 ++---
drivers/rtc/rtc-lpc32xx.c | 5 ++---
drivers/rtc/rtc-moxart.c | 4 +---
drivers/rtc/rtc-nuc900.c | 5 ++---
drivers/rtc/rtc-pm8xxx.c | 4 +---
drivers/rtc/rtc-rx8025.c | 1 -
drivers/rtc/rtc-sirfsoc.c | 6 +-----
drivers/rtc/rtc-spear.c | 4 +---
10 files changed, 12 insertions(+), 30 deletions(-)


2014-02-07 08:02:07

by Jingoo Han

[permalink] [raw]
Subject: [PATCH 01/10] rtc: rtc-at32ap700x: Remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.

Signed-off-by: Jingoo Han <[email protected]>
---
drivers/rtc/rtc-at32ap700x.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-at32ap700x.c b/drivers/rtc/rtc-at32ap700x.c
index 3161ab5..aee3387 100644
--- a/drivers/rtc/rtc-at32ap700x.c
+++ b/drivers/rtc/rtc-at32ap700x.c
@@ -204,10 +204,8 @@ static int __init at32_rtc_probe(struct platform_device *pdev)

rtc = devm_kzalloc(&pdev->dev, sizeof(struct rtc_at32ap700x),
GFP_KERNEL);
- if (!rtc) {
- dev_dbg(&pdev->dev, "out of memory\n");
+ if (!rtc)
return -ENOMEM;
- }

regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!regs) {
--
1.7.10.4

2014-02-07 08:02:49

by Jingoo Han

[permalink] [raw]
Subject: [PATCH 02/10] rtc: rtc-davinci: Remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.

Signed-off-by: Jingoo Han <[email protected]>
---
drivers/rtc/rtc-davinci.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-davinci.c b/drivers/rtc/rtc-davinci.c
index d3e70f3..c0a3b59 100644
--- a/drivers/rtc/rtc-davinci.c
+++ b/drivers/rtc/rtc-davinci.c
@@ -484,10 +484,8 @@ static int __init davinci_rtc_probe(struct platform_device *pdev)
int ret = 0;

davinci_rtc = devm_kzalloc(&pdev->dev, sizeof(struct davinci_rtc), GFP_KERNEL);
- if (!davinci_rtc) {
- dev_dbg(dev, "could not allocate memory for private data\n");
+ if (!davinci_rtc)
return -ENOMEM;
- }

davinci_rtc->irq = platform_get_irq(pdev, 0);
if (davinci_rtc->irq < 0) {
--
1.7.10.4

2014-02-07 08:03:52

by Jingoo Han

[permalink] [raw]
Subject: [PATCH 03/10] rtc: rtc-ds1390: Remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.

Signed-off-by: Jingoo Han <[email protected]>
---
drivers/rtc/rtc-ds1390.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-ds1390.c b/drivers/rtc/rtc-ds1390.c
index be9d8c0..e67bfcb 100644
--- a/drivers/rtc/rtc-ds1390.c
+++ b/drivers/rtc/rtc-ds1390.c
@@ -132,10 +132,9 @@ static int ds1390_probe(struct spi_device *spi)
spi_setup(spi);

chip = devm_kzalloc(&spi->dev, sizeof(*chip), GFP_KERNEL);
- if (!chip) {
- dev_err(&spi->dev, "unable to allocate device memory\n");
+ if (!chip)
return -ENOMEM;
- }
+
spi_set_drvdata(spi, chip);

res = ds1390_get_reg(&spi->dev, DS1390_REG_SECONDS, &tmp);
--
1.7.10.4

Subject: Re: [PATCH 01/10] rtc: rtc-at32ap700x: Remove unnecessary OOM messages

Around Fri 07 Feb 2014 17:02:02 +0900 or thereabout, Jingoo Han wrote:
> The site-specific OOM messages are unnecessary, because they
> duplicate the MM subsystem generic OOM message.

Thanks for cleaning up.

> Signed-off-by: Jingoo Han <[email protected]>
>

Acked-by: Hans-Christian Egtvedt <[email protected]>

> ---
> drivers/rtc/rtc-at32ap700x.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/rtc/rtc-at32ap700x.c b/drivers/rtc/rtc-at32ap700x.c
> index 3161ab5..aee3387 100644
> --- a/drivers/rtc/rtc-at32ap700x.c
> +++ b/drivers/rtc/rtc-at32ap700x.c
> @@ -204,10 +204,8 @@ static int __init at32_rtc_probe(struct platform_device *pdev)
>
> rtc = devm_kzalloc(&pdev->dev, sizeof(struct rtc_at32ap700x),
> GFP_KERNEL);
> - if (!rtc) {
> - dev_dbg(&pdev->dev, "out of memory\n");
> + if (!rtc)
> return -ENOMEM;
> - }
>
> regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> if (!regs) {
--
mvh
Hans-Christian Egtvedt

2014-02-07 08:06:55

by Jingoo Han

[permalink] [raw]
Subject: [PATCH 05/10] rtc: rtc-moxart: Remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.

Signed-off-by: Jingoo Han <[email protected]>
---
drivers/rtc/rtc-moxart.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-moxart.c b/drivers/rtc/rtc-moxart.c
index c29dee0..c318462 100644
--- a/drivers/rtc/rtc-moxart.c
+++ b/drivers/rtc/rtc-moxart.c
@@ -247,10 +247,8 @@ static int moxart_rtc_probe(struct platform_device *pdev)
int ret = 0;

moxart_rtc = devm_kzalloc(&pdev->dev, sizeof(*moxart_rtc), GFP_KERNEL);
- if (!moxart_rtc) {
- dev_err(&pdev->dev, "devm_kzalloc failed\n");
+ if (!moxart_rtc)
return -ENOMEM;
- }

moxart_rtc->gpio_data = of_get_named_gpio(pdev->dev.of_node,
"gpio-rtc-data", 0);
--
1.7.10.4

2014-02-07 08:07:19

by Jingoo Han

[permalink] [raw]
Subject: [PATCH 06/10] rtc: rtc-nuc900: Remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.

Signed-off-by: Jingoo Han <[email protected]>
---
drivers/rtc/rtc-nuc900.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-nuc900.c b/drivers/rtc/rtc-nuc900.c
index 248653c..a53da09 100644
--- a/drivers/rtc/rtc-nuc900.c
+++ b/drivers/rtc/rtc-nuc900.c
@@ -229,10 +229,9 @@ static int __init nuc900_rtc_probe(struct platform_device *pdev)

nuc900_rtc = devm_kzalloc(&pdev->dev, sizeof(struct nuc900_rtc),
GFP_KERNEL);
- if (!nuc900_rtc) {
- dev_err(&pdev->dev, "kzalloc nuc900_rtc failed\n");
+ if (!nuc900_rtc)
return -ENOMEM;
- }
+
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
nuc900_rtc->rtc_reg = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(nuc900_rtc->rtc_reg))
--
1.7.10.4

2014-02-07 08:09:23

by Jingoo Han

[permalink] [raw]
Subject: [PATCH 07/10] rtc: rtc-pm8xxx: Remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.

Signed-off-by: Jingoo Han <[email protected]>
---
drivers/rtc/rtc-pm8xxx.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c
index 03f8f75..bd76ffe 100644
--- a/drivers/rtc/rtc-pm8xxx.c
+++ b/drivers/rtc/rtc-pm8xxx.c
@@ -396,10 +396,8 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev)
rtc_write_enable = pdata->rtc_write_enable;

rtc_dd = devm_kzalloc(&pdev->dev, sizeof(*rtc_dd), GFP_KERNEL);
- if (rtc_dd == NULL) {
- dev_err(&pdev->dev, "Unable to allocate memory!\n");
+ if (rtc_dd == NULL)
return -ENOMEM;
- }

/* Initialise spinlock to protect RTC control register */
spin_lock_init(&rtc_dd->ctrl_reg_lock);
--
1.7.10.4

2014-02-07 08:11:11

by Jingoo Han

[permalink] [raw]
Subject: [PATCH 08/10] rtc: rtc-rx8025: Remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.

Signed-off-by: Jingoo Han <[email protected]>
---
drivers/rtc/rtc-rx8025.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c
index 8fa23ea..e6298e0 100644
--- a/drivers/rtc/rtc-rx8025.c
+++ b/drivers/rtc/rtc-rx8025.c
@@ -551,7 +551,6 @@ static int rx8025_probe(struct i2c_client *client,

rx8025 = devm_kzalloc(&client->dev, sizeof(*rx8025), GFP_KERNEL);
if (!rx8025) {
- dev_err(&adapter->dev, "failed to alloc memory\n");
err = -ENOMEM;
goto errout;
}
--
1.7.10.4

2014-02-07 08:12:13

by Jingoo Han

[permalink] [raw]
Subject: [PATCH 09/10] rtc: rtc-sirfsoc: Remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.

Signed-off-by: Jingoo Han <[email protected]>
---
drivers/rtc/rtc-sirfsoc.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/rtc/rtc-sirfsoc.c b/drivers/rtc/rtc-sirfsoc.c
index 3eb3642..9e3cbce 100644
--- a/drivers/rtc/rtc-sirfsoc.c
+++ b/drivers/rtc/rtc-sirfsoc.c
@@ -264,12 +264,8 @@ static int sirfsoc_rtc_probe(struct platform_device *pdev)

rtcdrv = devm_kzalloc(&pdev->dev,
sizeof(struct sirfsoc_rtc_drv), GFP_KERNEL);
- if (rtcdrv == NULL) {
- dev_err(&pdev->dev,
- "%s: can't alloc mem for drv struct\n",
- pdev->name);
+ if (rtcdrv == NULL)
return -ENOMEM;
- }

err = of_property_read_u32(np, "reg", &rtcdrv->rtc_base);
if (err) {
--
1.7.10.4

2014-02-07 08:14:09

by Jingoo Han

[permalink] [raw]
Subject: [PATCH 04/10] rtc: rtc-lpc32xx: Remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.

Signed-off-by: Jingoo Han <[email protected]>
---
drivers/rtc/rtc-lpc32xx.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-lpc32xx.c b/drivers/rtc/rtc-lpc32xx.c
index bfdbcb8..f130c08 100644
--- a/drivers/rtc/rtc-lpc32xx.c
+++ b/drivers/rtc/rtc-lpc32xx.c
@@ -211,10 +211,9 @@ static int lpc32xx_rtc_probe(struct platform_device *pdev)
}

rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
- if (unlikely(!rtc)) {
- dev_err(&pdev->dev, "Can't allocate memory\n");
+ if (unlikely(!rtc))
return -ENOMEM;
- }
+
rtc->irq = rtcirq;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
--
1.7.10.4

2014-02-07 08:15:23

by Jingoo Han

[permalink] [raw]
Subject: [PATCH 10/10] rtc: rtc-spear: Remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.

Signed-off-by: Jingoo Han <[email protected]>
---
drivers/rtc/rtc-spear.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c
index c492cf0..d2cdb98 100644
--- a/drivers/rtc/rtc-spear.c
+++ b/drivers/rtc/rtc-spear.c
@@ -365,10 +365,8 @@ static int spear_rtc_probe(struct platform_device *pdev)
}

config = devm_kzalloc(&pdev->dev, sizeof(*config), GFP_KERNEL);
- if (!config) {
- dev_err(&pdev->dev, "out of memory\n");
+ if (!config)
return -ENOMEM;
- }

/* alarm irqs */
irq = platform_get_irq(pdev, 0);
--
1.7.10.4

2014-02-07 10:07:15

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH 10/10] rtc: rtc-spear: Remove unnecessary OOM messages

On 7 February 2014 13:45, Jingoo Han <[email protected]> wrote:
> The site-specific OOM messages are unnecessary, because they
> duplicate the MM subsystem generic OOM message.
>
> Signed-off-by: Jingoo Han <[email protected]>
> ---
> drivers/rtc/rtc-spear.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c
> index c492cf0..d2cdb98 100644
> --- a/drivers/rtc/rtc-spear.c
> +++ b/drivers/rtc/rtc-spear.c
> @@ -365,10 +365,8 @@ static int spear_rtc_probe(struct platform_device *pdev)
> }
>
> config = devm_kzalloc(&pdev->dev, sizeof(*config), GFP_KERNEL);
> - if (!config) {
> - dev_err(&pdev->dev, "out of memory\n");
> + if (!config)
> return -ENOMEM;
> - }
>
> /* alarm irqs */
> irq = platform_get_irq(pdev, 0);

Acked-by: Viresh Kumar <[email protected]>

2014-02-07 12:08:55

by Barry Song

[permalink] [raw]
Subject: Re: [PATCH 09/10] rtc: rtc-sirfsoc: Remove unnecessary OOM messages

2014-02-07 16:12 GMT+08:00 Jingoo Han <[email protected]>:
> The site-specific OOM messages are unnecessary, because they
> duplicate the MM subsystem generic OOM message.
>
> Signed-off-by: Jingoo Han <[email protected]>
> ---

Acked-by: Barry Song <[email protected]>

> drivers/rtc/rtc-sirfsoc.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/rtc/rtc-sirfsoc.c b/drivers/rtc/rtc-sirfsoc.c
> index 3eb3642..9e3cbce 100644
> --- a/drivers/rtc/rtc-sirfsoc.c
> +++ b/drivers/rtc/rtc-sirfsoc.c
> @@ -264,12 +264,8 @@ static int sirfsoc_rtc_probe(struct platform_device *pdev)
>
> rtcdrv = devm_kzalloc(&pdev->dev,
> sizeof(struct sirfsoc_rtc_drv), GFP_KERNEL);
> - if (rtcdrv == NULL) {
> - dev_err(&pdev->dev,
> - "%s: can't alloc mem for drv struct\n",
> - pdev->name);
> + if (rtcdrv == NULL)
> return -ENOMEM;
> - }
>
> err = of_property_read_u32(np, "reg", &rtcdrv->rtc_base);
> if (err) {
> --
> 1.7.10.4
>
>
-barry