Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1285241

[PATCH 11/19] mfd: as3711: Repair OOM and 'line over 80 chars' formatting warnings

From Lee Jones <lee.jones@linaro.org>
Newsgroups linux.kernel
Subject [PATCH 11/19] mfd: as3711: Repair OOM and 'line over 80 chars' formatting warnings
Date 2015-12-07 13:00 +0100
Message-ID <qD2Cv-3Yl-37@gated-at.bofh.it> (permalink)
References <qD2Ct-3Yl-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


WARNING: Possible unnecessary 'out of memory' message
+               if (!pdata) {
+                       dev_err(&client->dev, "Failed to allocate pdata\n");

WARNING: Possible unnecessary 'out of memory' message
+       if (!as3711) {
+               dev_err(&client->dev, "Memory allocation failed\n");

WARNING: line over 80 characters
+               dev_err(&client->dev, "regmap initialization failed: %d\n", ret);

WARNING: line over 80 characters
+       /* We can reuse as3711_subdevs[], it will be copied in mfd_add_devices() */

WARNING: line over 80 characters
+               as3711_subdevs[AS3711_REGULATOR].platform_data = &pdata->regulator;

WARNING: line over 80 characters
+               as3711_subdevs[AS3711_REGULATOR].pdata_size = sizeof(pdata->regulator);

WARNING: line over 80 characters
+               as3711_subdevs[AS3711_BACKLIGHT].platform_data = &pdata->backlight;

WARNING: line over 80 characters
+               as3711_subdevs[AS3711_BACKLIGHT].pdata_size = sizeof(pdata->backlight);

total: 0 errors, 8 warnings, 236 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/as3711.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/mfd/as3711.c b/drivers/mfd/as3711.c
index d001f7e2..94d67a6 100644
--- a/drivers/mfd/as3711.c
+++ b/drivers/mfd/as3711.c
@@ -136,17 +136,13 @@ static int as3711_i2c_probe(struct i2c_client *client,
 	} else {
 		pdata = devm_kzalloc(&client->dev,
 				     sizeof(*pdata), GFP_KERNEL);
-		if (!pdata) {
-			dev_err(&client->dev, "Failed to allocate pdata\n");
+		if (!pdata)
 			return -ENOMEM;
-		}
 	}
 
 	as3711 = devm_kzalloc(&client->dev, sizeof(struct as3711), GFP_KERNEL);
-	if (!as3711) {
-		dev_err(&client->dev, "Memory allocation failed\n");
+	if (!as3711)
 		return -ENOMEM;
-	}
 
 	as3711->dev = &client->dev;
 	i2c_set_clientdata(client, as3711);
@@ -157,7 +153,8 @@ static int as3711_i2c_probe(struct i2c_client *client,
 	as3711->regmap = devm_regmap_init_i2c(client, &as3711_regmap_config);
 	if (IS_ERR(as3711->regmap)) {
 		ret = PTR_ERR(as3711->regmap);
-		dev_err(&client->dev, "regmap initialization failed: %d\n", ret);
+		dev_err(&client->dev,
+			"regmap initialization failed: %d\n", ret);
 		return ret;
 	}
 
@@ -172,12 +169,19 @@ static int as3711_i2c_probe(struct i2c_client *client,
 		return -ENODEV;
 	dev_info(as3711->dev, "AS3711 detected: %x:%x\n", id1, id2);
 
-	/* We can reuse as3711_subdevs[], it will be copied in mfd_add_devices() */
+	/*
+	 * We can reuse as3711_subdevs[],
+	 * it will be copied in mfd_add_devices()
+	 */
 	if (pdata) {
-		as3711_subdevs[AS3711_REGULATOR].platform_data = &pdata->regulator;
-		as3711_subdevs[AS3711_REGULATOR].pdata_size = sizeof(pdata->regulator);
-		as3711_subdevs[AS3711_BACKLIGHT].platform_data = &pdata->backlight;
-		as3711_subdevs[AS3711_BACKLIGHT].pdata_size = sizeof(pdata->backlight);
+		as3711_subdevs[AS3711_REGULATOR].platform_data =
+			&pdata->regulator;
+		as3711_subdevs[AS3711_REGULATOR].pdata_size =
+			sizeof(pdata->regulator);
+		as3711_subdevs[AS3711_BACKLIGHT].platform_data =
+			&pdata->backlight;
+		as3711_subdevs[AS3711_BACKLIGHT].pdata_size =
+			sizeof(pdata->backlight);
 	} else {
 		as3711_subdevs[AS3711_REGULATOR].platform_data = NULL;
 		as3711_subdevs[AS3711_REGULATOR].pdata_size = 0;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/19] mfd: Lots of clean-ups Lee Jones <lee.jones@linaro.org> - 2015-12-07 13:00 +0100
  [PATCH 15/19] mfd: cs5535-mfd: Add missing line spacing and make local array static Lee Jones <lee.jones@linaro.org> - 2015-12-07 13:00 +0100
  [PATCH 08/19] mfd: adp5520: Some trivial 'no space before tab' fixes Lee Jones <lee.jones@linaro.org> - 2015-12-07 13:00 +0100
  [PATCH 04/19] mfd: ab8500-core: Fix many warnings reported by Checkpatch Lee Jones <lee.jones@linaro.org> - 2015-12-07 13:00 +0100
  [PATCH 11/19] mfd: as3711: Repair OOM and 'line over 80 chars' formatting warnings Lee Jones <lee.jones@linaro.org> - 2015-12-07 13:00 +0100
  [PATCH 17/19] mfd: da9052-i2c: Fix tabbing/whitespace issue Lee Jones <lee.jones@linaro.org> - 2015-12-07 13:00 +0100
  [PATCH 16/19] mfd: da903x: Fix white space and split string issues Lee Jones <lee.jones@linaro.org> - 2015-12-07 13:00 +0100
  [PATCH 03/19] mfd: ab2100-otp: Remove pointless 'out of memory' error message Lee Jones <lee.jones@linaro.org> - 2015-12-07 13:00 +0100
  [PATCH 05/19] mfd: ab8500-debugfs: Clean-up non-conforming commenting and print formatting Lee Jones <lee.jones@linaro.org> - 2015-12-07 13:00 +0100
  [PATCH 18/19] mfd: da9052-irq: Fix trivial 'space before comma' error Lee Jones <lee.jones@linaro.org> - 2015-12-07 13:00 +0100
  [PATCH 06/19] mfd: ab8500-gpadc: Squash a whole bunch of Checkpatch warnings and one error Lee Jones <lee.jones@linaro.org> - 2015-12-07 13:00 +0100
  [PATCH 01/19] mfd: aat2870-core: Remove unnecessary 'out of memory' message Lee Jones <lee.jones@linaro.org> - 2015-12-07 13:00 +0100
  [PATCH 10/19] mfd: arizona-i2c: Add blank line formatting after declaration Lee Jones <lee.jones@linaro.org> - 2015-12-07 13:00 +0100
    Re: [PATCH 10/19] mfd: arizona-i2c: Add blank line formatting after  declaration Charles Keepax <ckeepax@opensource.wolfsonmicro.com> - 2015-12-08 15:40 +0100
  [PATCH 02/19] mfd: ab3100-core.c: Fix multiple warnings reported by Checkpatch Lee Jones <lee.jones@linaro.org> - 2015-12-07 13:00 +0100

csiph-web