linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] regulator: bcm590xx: remove unnecessary OOM messages
@ 2014-06-02  6:27 Jingoo Han
  2014-06-02  6:29 ` [PATCH 2/3] regulator: max8649: " Jingoo Han
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Jingoo Han @ 2014-06-02  6:27 UTC (permalink / raw)
  To: 'Mark Brown'
  Cc: 'Liam Girdwood', linux-kernel, 'Jingoo Han',
	'Matt Porter', 'Tim Kryger'

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

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/regulator/bcm590xx-regulator.c |   16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/regulator/bcm590xx-regulator.c b/drivers/regulator/bcm590xx-regulator.c
index 57544e2..fb8c6f7 100644
--- a/drivers/regulator/bcm590xx-regulator.c
+++ b/drivers/regulator/bcm590xx-regulator.c
@@ -326,10 +326,8 @@ static struct bcm590xx_board *bcm590xx_parse_dt_reg_data(
 	}
 
 	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
-	if (!data) {
-		dev_err(&pdev->dev, "failed to allocate regulator board data\n");
+	if (!data)
 		return NULL;
-	}
 
 	np = of_node_get(np);
 	regulators = of_get_child_by_name(np, "regulators");
@@ -374,10 +372,8 @@ static int bcm590xx_probe(struct platform_device *pdev)
 					      &bcm590xx_reg_matches);
 
 	pmu = devm_kzalloc(&pdev->dev, sizeof(*pmu), GFP_KERNEL);
-	if (!pmu) {
-		dev_err(&pdev->dev, "Memory allocation failed for pmu\n");
+	if (!pmu)
 		return -ENOMEM;
-	}
 
 	pmu->mfd = bcm590xx;
 
@@ -385,17 +381,13 @@ static int bcm590xx_probe(struct platform_device *pdev)
 
 	pmu->desc = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
 			sizeof(struct regulator_desc), GFP_KERNEL);
-	if (!pmu->desc) {
-		dev_err(&pdev->dev, "Memory alloc fails for desc\n");
+	if (!pmu->desc)
 		return -ENOMEM;
-	}
 
 	pmu->info = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
 			sizeof(struct bcm590xx_info *), GFP_KERNEL);
-	if (!pmu->info) {
-		dev_err(&pdev->dev, "Memory alloc fails for info\n");
+	if (!pmu->info)
 		return -ENOMEM;
-	}
 
 	info = bcm590xx_regs;
 
-- 
1.7.10.4



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

* [PATCH 2/3] regulator: max8649: remove unnecessary OOM messages
  2014-06-02  6:27 [PATCH 1/3] regulator: bcm590xx: remove unnecessary OOM messages Jingoo Han
@ 2014-06-02  6:29 ` Jingoo Han
  2014-06-02 14:12   ` Mark Brown
  2014-06-02  6:30 ` [PATCH 3/3] regulator: pbias: " Jingoo Han
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Jingoo Han @ 2014-06-02  6:29 UTC (permalink / raw)
  To: 'Mark Brown'
  Cc: 'Liam Girdwood', linux-kernel, 'Jingoo Han',
	'Haojian Zhuang'

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

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/regulator/max8649.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c
index 3172da8..c8bddcc 100644
--- a/drivers/regulator/max8649.c
+++ b/drivers/regulator/max8649.c
@@ -161,10 +161,8 @@ static int max8649_regulator_probe(struct i2c_client *client,
 
 	info = devm_kzalloc(&client->dev, sizeof(struct max8649_regulator_info),
 			    GFP_KERNEL);
-	if (!info) {
-		dev_err(&client->dev, "No enough memory\n");
+	if (!info)
 		return -ENOMEM;
-	}
 
 	info->regmap = devm_regmap_init_i2c(client, &max8649_regmap_config);
 	if (IS_ERR(info->regmap)) {
-- 
1.7.10.4



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

* [PATCH 3/3] regulator: pbias: remove unnecessary OOM messages
  2014-06-02  6:27 [PATCH 1/3] regulator: bcm590xx: remove unnecessary OOM messages Jingoo Han
  2014-06-02  6:29 ` [PATCH 2/3] regulator: max8649: " Jingoo Han
@ 2014-06-02  6:30 ` Jingoo Han
  2014-06-02 14:15   ` Mark Brown
  2014-06-02  7:12 ` [PATCH 1/3] regulator: bcm590xx: " Tim Kryger
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Jingoo Han @ 2014-06-02  6:30 UTC (permalink / raw)
  To: 'Mark Brown'
  Cc: 'Liam Girdwood', linux-kernel, 'Jingoo Han',
	'Balaji T K'

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

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/regulator/pbias-regulator.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/pbias-regulator.c b/drivers/regulator/pbias-regulator.c
index 708ddbb..6d02d68 100644
--- a/drivers/regulator/pbias-regulator.c
+++ b/drivers/regulator/pbias-regulator.c
@@ -122,10 +122,8 @@ static int pbias_regulator_probe(struct platform_device *pdev)
 
 	drvdata = devm_kzalloc(&pdev->dev, sizeof(struct pbias_regulator_data)
 			       * count, GFP_KERNEL);
-	if (drvdata == NULL) {
-		dev_err(&pdev->dev, "Failed to allocate device data\n");
+	if (!drvdata)
 		return -ENOMEM;
-	}
 
 	syscon = syscon_regmap_lookup_by_phandle(np, "syscon");
 	if (IS_ERR(syscon))
-- 
1.7.10.4



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

* Re: [PATCH 1/3] regulator: bcm590xx: remove unnecessary OOM messages
  2014-06-02  6:27 [PATCH 1/3] regulator: bcm590xx: remove unnecessary OOM messages Jingoo Han
  2014-06-02  6:29 ` [PATCH 2/3] regulator: max8649: " Jingoo Han
  2014-06-02  6:30 ` [PATCH 3/3] regulator: pbias: " Jingoo Han
@ 2014-06-02  7:12 ` Tim Kryger
  2014-06-02 12:50   ` Mark Brown
  2014-06-03 15:19 ` 'Matt Porter'
  2014-06-06 10:08 ` Mark Brown
  4 siblings, 1 reply; 11+ messages in thread
From: Tim Kryger @ 2014-06-02  7:12 UTC (permalink / raw)
  To: Jingoo Han
  Cc: Mark Brown, Liam Girdwood, linux-kernel, Matt Porter, Tim Kryger

On Sun, Jun 1, 2014 at 11:27 PM, Jingoo Han <jg1.han@samsung.com> wrote:
> The site-specific OOM messages are unnecessary, because they
> duplicate the MM subsystem generic OOM message.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> ---
>  drivers/regulator/bcm590xx-regulator.c |   16 ++++------------
>  1 file changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/regulator/bcm590xx-regulator.c b/drivers/regulator/bcm590xx-regulator.c
> index 57544e2..fb8c6f7 100644
> --- a/drivers/regulator/bcm590xx-regulator.c
> +++ b/drivers/regulator/bcm590xx-regulator.c
> @@ -326,10 +326,8 @@ static struct bcm590xx_board *bcm590xx_parse_dt_reg_data(
>         }
>
>         data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
> -       if (!data) {
> -               dev_err(&pdev->dev, "failed to allocate regulator board data\n");
> +       if (!data)
>                 return NULL;
> -       }
>
>         np = of_node_get(np);
>         regulators = of_get_child_by_name(np, "regulators");
> @@ -374,10 +372,8 @@ static int bcm590xx_probe(struct platform_device *pdev)
>                                               &bcm590xx_reg_matches);
>
>         pmu = devm_kzalloc(&pdev->dev, sizeof(*pmu), GFP_KERNEL);
> -       if (!pmu) {
> -               dev_err(&pdev->dev, "Memory allocation failed for pmu\n");
> +       if (!pmu)
>                 return -ENOMEM;
> -       }
>
>         pmu->mfd = bcm590xx;
>
> @@ -385,17 +381,13 @@ static int bcm590xx_probe(struct platform_device *pdev)
>
>         pmu->desc = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
>                         sizeof(struct regulator_desc), GFP_KERNEL);
> -       if (!pmu->desc) {
> -               dev_err(&pdev->dev, "Memory alloc fails for desc\n");
> +       if (!pmu->desc)
>                 return -ENOMEM;
> -       }
>
>         pmu->info = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
>                         sizeof(struct bcm590xx_info *), GFP_KERNEL);
> -       if (!pmu->info) {
> -               dev_err(&pdev->dev, "Memory alloc fails for info\n");
> +       if (!pmu->info)
>                 return -ENOMEM;
> -       }
>
>         info = bcm590xx_regs;
>

For the other two drivers touched by this patch series, the probe
methods only include a single dynamic memory allocation.  As such, the
stack trace provided by the generic memory code is sufficient to
quickly identify where the failure occurred.

The probe method of this driver, on the other hand, performs several
allocations and the error messages you intend to remove conveniently
pinpoint which one failed.  While the offsets in the trace could be
used to derive the same information, I am skeptical that is enough to
justify removing the messages.

Thanks,
Tim Kryger

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

* Re: [PATCH 1/3] regulator: bcm590xx: remove unnecessary OOM messages
  2014-06-02  7:12 ` [PATCH 1/3] regulator: bcm590xx: " Tim Kryger
@ 2014-06-02 12:50   ` Mark Brown
  2014-06-03  6:41     ` Tim Kryger
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Brown @ 2014-06-02 12:50 UTC (permalink / raw)
  To: Tim Kryger
  Cc: Jingoo Han, Liam Girdwood, linux-kernel, Matt Porter, Tim Kryger

[-- Attachment #1: Type: text/plain, Size: 473 bytes --]

On Mon, Jun 02, 2014 at 12:12:20AM -0700, Tim Kryger wrote:

> The probe method of this driver, on the other hand, performs several
> allocations and the error messages you intend to remove conveniently
> pinpoint which one failed.  While the offsets in the trace could be
> used to derive the same information, I am skeptical that is enough to
> justify removing the messages.

On the other hand how likely is anyone to care which particular
allocation triggered the OOM?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 2/3] regulator: max8649: remove unnecessary OOM messages
  2014-06-02  6:29 ` [PATCH 2/3] regulator: max8649: " Jingoo Han
@ 2014-06-02 14:12   ` Mark Brown
  0 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2014-06-02 14:12 UTC (permalink / raw)
  To: Jingoo Han
  Cc: 'Liam Girdwood', linux-kernel, 'Haojian Zhuang'

[-- Attachment #1: Type: text/plain, Size: 191 bytes --]

On Mon, Jun 02, 2014 at 03:29:57PM +0900, Jingoo Han wrote:
> The site-specific OOM messages are unnecessary, because they
> duplicate the MM subsystem generic OOM message.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 3/3] regulator: pbias: remove unnecessary OOM messages
  2014-06-02  6:30 ` [PATCH 3/3] regulator: pbias: " Jingoo Han
@ 2014-06-02 14:15   ` Mark Brown
  0 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2014-06-02 14:15 UTC (permalink / raw)
  To: Jingoo Han; +Cc: 'Liam Girdwood', linux-kernel, 'Balaji T K'

[-- Attachment #1: Type: text/plain, Size: 191 bytes --]

On Mon, Jun 02, 2014 at 03:30:44PM +0900, Jingoo Han wrote:
> The site-specific OOM messages are unnecessary, because they
> duplicate the MM subsystem generic OOM message.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/3] regulator: bcm590xx: remove unnecessary OOM messages
  2014-06-02 12:50   ` Mark Brown
@ 2014-06-03  6:41     ` Tim Kryger
  2014-06-03 10:05       ` Mark Brown
  0 siblings, 1 reply; 11+ messages in thread
From: Tim Kryger @ 2014-06-03  6:41 UTC (permalink / raw)
  To: Mark Brown
  Cc: Jingoo Han, Liam Girdwood, linux-kernel, Matt Porter, Tim Kryger

On Mon, Jun 2, 2014 at 5:50 AM, Mark Brown <broonie@kernel.org> wrote:
> On Mon, Jun 02, 2014 at 12:12:20AM -0700, Tim Kryger wrote:
>
>> The probe method of this driver, on the other hand, performs several
>> allocations and the error messages you intend to remove conveniently
>> pinpoint which one failed.  While the offsets in the trace could be
>> used to derive the same information, I am skeptical that is enough to
>> justify removing the messages.
>
> On the other hand how likely is anyone to care which particular
> allocation triggered the OOM?

I suppose you would only care if a failure was due to something unique
about a specific allocation.  For example, if someone made a foolish
change to a structure that resulted in a request for substantially
more memory, the messages would lead directly to the problem.

The real question is whether this change improves the driver.  To me,
it seems like a draw.

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

* Re: [PATCH 1/3] regulator: bcm590xx: remove unnecessary OOM messages
  2014-06-03  6:41     ` Tim Kryger
@ 2014-06-03 10:05       ` Mark Brown
  0 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2014-06-03 10:05 UTC (permalink / raw)
  To: Tim Kryger
  Cc: Jingoo Han, Liam Girdwood, linux-kernel, Matt Porter, Tim Kryger

[-- Attachment #1: Type: text/plain, Size: 533 bytes --]

On Mon, Jun 02, 2014 at 11:41:01PM -0700, Tim Kryger wrote:

> The real question is whether this change improves the driver.  To me,
> it seems like a draw.

It's not really for the benefit of the driver, it's for the benefit of
the kernel as a whole - the individually hand crafted error messages all
take up space in the kernel so if we just remove them and rely on the
OOM messages being loud we will in aggregate save some not completely
trivial amount of space in the kernel image.  Not a *massive* amount but
somewhat helpful.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/3] regulator: bcm590xx: remove unnecessary OOM messages
  2014-06-02  6:27 [PATCH 1/3] regulator: bcm590xx: remove unnecessary OOM messages Jingoo Han
                   ` (2 preceding siblings ...)
  2014-06-02  7:12 ` [PATCH 1/3] regulator: bcm590xx: " Tim Kryger
@ 2014-06-03 15:19 ` 'Matt Porter'
  2014-06-06 10:08 ` Mark Brown
  4 siblings, 0 replies; 11+ messages in thread
From: 'Matt Porter' @ 2014-06-03 15:19 UTC (permalink / raw)
  To: Jingoo Han
  Cc: 'Mark Brown', 'Liam Girdwood',
	linux-kernel, 'Tim Kryger'

On Mon, Jun 02, 2014 at 03:27:21PM +0900, Jingoo Han wrote:
> The site-specific OOM messages are unnecessary, because they
> duplicate the MM subsystem generic OOM message.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> ---
>  drivers/regulator/bcm590xx-regulator.c |   16 ++++------------
>  1 file changed, 4 insertions(+), 12 deletions(-)

Looks good, thanks.

Acked-by: Matt Porter <mporter@linaro.org>

> diff --git a/drivers/regulator/bcm590xx-regulator.c b/drivers/regulator/bcm590xx-regulator.c
> index 57544e2..fb8c6f7 100644
> --- a/drivers/regulator/bcm590xx-regulator.c
> +++ b/drivers/regulator/bcm590xx-regulator.c
> @@ -326,10 +326,8 @@ static struct bcm590xx_board *bcm590xx_parse_dt_reg_data(
>  	}
>  
>  	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
> -	if (!data) {
> -		dev_err(&pdev->dev, "failed to allocate regulator board data\n");
> +	if (!data)
>  		return NULL;
> -	}
>  
>  	np = of_node_get(np);
>  	regulators = of_get_child_by_name(np, "regulators");
> @@ -374,10 +372,8 @@ static int bcm590xx_probe(struct platform_device *pdev)
>  					      &bcm590xx_reg_matches);
>  
>  	pmu = devm_kzalloc(&pdev->dev, sizeof(*pmu), GFP_KERNEL);
> -	if (!pmu) {
> -		dev_err(&pdev->dev, "Memory allocation failed for pmu\n");
> +	if (!pmu)
>  		return -ENOMEM;
> -	}
>  
>  	pmu->mfd = bcm590xx;
>  
> @@ -385,17 +381,13 @@ static int bcm590xx_probe(struct platform_device *pdev)
>  
>  	pmu->desc = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
>  			sizeof(struct regulator_desc), GFP_KERNEL);
> -	if (!pmu->desc) {
> -		dev_err(&pdev->dev, "Memory alloc fails for desc\n");
> +	if (!pmu->desc)
>  		return -ENOMEM;
> -	}
>  
>  	pmu->info = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
>  			sizeof(struct bcm590xx_info *), GFP_KERNEL);
> -	if (!pmu->info) {
> -		dev_err(&pdev->dev, "Memory alloc fails for info\n");
> +	if (!pmu->info)
>  		return -ENOMEM;
> -	}
>  
>  	info = bcm590xx_regs;
>  
> -- 
> 1.7.10.4
> 
> 

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

* Re: [PATCH 1/3] regulator: bcm590xx: remove unnecessary OOM messages
  2014-06-02  6:27 [PATCH 1/3] regulator: bcm590xx: remove unnecessary OOM messages Jingoo Han
                   ` (3 preceding siblings ...)
  2014-06-03 15:19 ` 'Matt Porter'
@ 2014-06-06 10:08 ` Mark Brown
  4 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2014-06-06 10:08 UTC (permalink / raw)
  To: Jingoo Han
  Cc: 'Liam Girdwood', linux-kernel, 'Matt Porter',
	'Tim Kryger'

[-- Attachment #1: Type: text/plain, Size: 191 bytes --]

On Mon, Jun 02, 2014 at 03:27:21PM +0900, Jingoo Han wrote:
> The site-specific OOM messages are unnecessary, because they
> duplicate the MM subsystem generic OOM message.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2014-06-06 10:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-02  6:27 [PATCH 1/3] regulator: bcm590xx: remove unnecessary OOM messages Jingoo Han
2014-06-02  6:29 ` [PATCH 2/3] regulator: max8649: " Jingoo Han
2014-06-02 14:12   ` Mark Brown
2014-06-02  6:30 ` [PATCH 3/3] regulator: pbias: " Jingoo Han
2014-06-02 14:15   ` Mark Brown
2014-06-02  7:12 ` [PATCH 1/3] regulator: bcm590xx: " Tim Kryger
2014-06-02 12:50   ` Mark Brown
2014-06-03  6:41     ` Tim Kryger
2014-06-03 10:05       ` Mark Brown
2014-06-03 15:19 ` 'Matt Porter'
2014-06-06 10:08 ` Mark Brown

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).