Skip to contentSkip to conversation

Drivers: power: max8997_charger: Fixed coding style and irrelevant messages

PATCH In review Shivani Bhardwaj 2 participants 2 messages Sep 29, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Drivers: power: max8997_charger: Fixed coding style and irrelevant messages

Added blank line after declaration of variables and commented out an unnecessary error print statement.

---
 drivers/power/max8997_charger.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/power/max8997_charger.c +2 -1
index 0b2eab5..00127f3 100644
@@ -106,6 +106,7 @@ static int max8997_battery_probe(struct platform_device *pdev)
 
 	if (pdata->eoc_mA) {
 		int val = (pdata->eoc_mA - 50) / 10;
+
 		if (val < 0)
 			val = 0;
 		if (val > 0xf)
@@ -149,7 +150,7 @@ static int max8997_battery_probe(struct platform_device *pdev)
 	charger = devm_kzalloc(&pdev->dev, sizeof(struct charger_data),
 				GFP_KERNEL);
 	if (charger == NULL) {
-		dev_err(&pdev->dev, "Cannot allocate memory.\n");
+		/*dev_err(&pdev->dev, "Cannot allocate memory.\n");*/
 		return -ENOMEM;
 	}
 
Signature · 1 line
2.1.0
#1 lore raw
Quoted 2 lines · Shivani Bhardwaj

Added blank line after declaration of variables and commented out an unnecessary error print statement.

See the comments on the other two patches. But another issue is that this does two completely unrelated things. They should be in different patches, so that if one of them turns out not to be a good idea, it will be easier to just apply the other.

julia

Quoted 36 lines
---
 drivers/power/max8997_charger.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/power/max8997_charger.c +2 -1
index 0b2eab5..00127f3 100644
@@ -106,6 +106,7 @@ static int max8997_battery_probe(struct platform_device *pdev)
 
 	if (pdata->eoc_mA) {
 		int val = (pdata->eoc_mA - 50) / 10;
+
 		if (val < 0)
 			val = 0;
 		if (val > 0xf)
@@ -149,7 +150,7 @@ static int max8997_battery_probe(struct platform_device *pdev)
 	charger = devm_kzalloc(&pdev->dev, sizeof(struct charger_data),
 				GFP_KERNEL);
 	if (charger == NULL) {
-		dev_err(&pdev->dev, "Cannot allocate memory.\n");
+		/*dev_err(&pdev->dev, "Cannot allocate memory.\n");*/
 		return -ENOMEM;
 	}
 
Signature · 8 lines
2.1.0

-- 
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20150929212257.GA13394%40ubuntu.
For more options, visit https://groups.google.com/d/optout.