linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH 04/19] mfd: ab8500-core: Fix many warnings reported by Checkpatch
Date: Mon,  7 Dec 2015 11:50:17 +0000	[thread overview]
Message-ID: <1449489032-14374-5-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1449489032-14374-1-git-send-email-lee.jones@linaro.org>

WARNING: Block comments use a trailing */ on a separate line
+        * */

WARNING: Block comments use a trailing */ on a separate line
+        * bank on higher 8 bits and reg in lower */

WARNING: Block comments use a trailing */ on a separate line
+        * bank on higher 8 bits and reg in lower */

WARNING: suspect code indent for conditional statements (8, 24)
+       if (unlikely(*offset == 17))
+                       *offset = 24;

WARNING: suspect code indent for conditional statements (8, 24)
+       if (unlikely(*offset == 16))
+                       *offset = 25;

WARNING: suspect code indent for conditional statements (8, 24)
+       if ((i == 3) && (*offset >= 24))
+                       *offset += 2;

WARNING: ENOSYS means 'invalid syscall nr' and nothing else
+               return -ENOSYS;

WARNING: static const char * array should probably be static const char * const
+       static const char *switch_off_status[] = {

WARNING: static const char * array should probably be static const char * const
+       static const char *turn_on_status[] = {

total: 0 errors, 9 warnings, 1867 lines checked

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/ab8500-core.c | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index fefbe4c..4080f01 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -113,7 +113,7 @@
 #define AB8500_SWITCH_OFF_STATUS	0x00
 
 #define AB8500_TURN_ON_STATUS		0x00
-#define AB8505_TURN_ON_STATUS_2	0x04
+#define AB8505_TURN_ON_STATUS_2		0x04
 
 #define AB8500_CH_USBCH_STAT1_REG	0x02
 #define VBUS_DET_DBNC100		0x02
@@ -211,7 +211,7 @@ static int set_register_interruptible(struct ab8500 *ab8500, u8 bank,
 	/*
 	 * Put the u8 bank and u8 register together into a an u16.
 	 * The bank on higher 8 bits and register in lower 8 bits.
-	 * */
+	 */
 	u16 addr = ((u16)bank) << 8 | reg;
 
 	dev_vdbg(ab8500->dev, "wr: addr %#x <= %#x\n", addr, data);
@@ -243,8 +243,6 @@ static int get_register_interruptible(struct ab8500 *ab8500, u8 bank,
 	u8 reg, u8 *value)
 {
 	int ret;
-	/* put the u8 bank and u8 reg together into a an u16.
-	 * bank on higher 8 bits and reg in lower */
 	u16 addr = ((u16)bank) << 8 | reg;
 
 	mutex_lock(&ab8500->lock);
@@ -278,8 +276,6 @@ static int mask_and_set_register_interruptible(struct ab8500 *ab8500, u8 bank,
 	u8 reg, u8 bitmask, u8 bitvalues)
 {
 	int ret;
-	/* put the u8 bank and u8 reg together into a an u16.
-	 * bank on higher 8 bits and reg in lower */
 	u16 addr = ((u16)bank) << 8 | reg;
 
 	mutex_lock(&ab8500->lock);
@@ -449,12 +445,12 @@ static void update_latch_offset(u8 *offset, int i)
 {
 	/* Fix inconsistent ITFromLatch25 bit mapping... */
 	if (unlikely(*offset == 17))
-			*offset = 24;
+		*offset = 24;
 	/* Fix inconsistent ab8540 bit mapping... */
 	if (unlikely(*offset == 16))
-			*offset = 25;
+		*offset = 25;
 	if ((i == 3) && (*offset >= 24))
-			*offset += 2;
+		*offset += 2;
 }
 
 static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500,
@@ -590,12 +586,12 @@ static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np)
 
 	/* If ->irq_base is zero this will give a linear mapping */
 	ab8500->domain = irq_domain_add_simple(ab8500->dev->of_node,
-			num_irqs, 0,
-			&ab8500_irq_ops, ab8500);
+					       num_irqs, 0,
+					       &ab8500_irq_ops, ab8500);
 
 	if (!ab8500->domain) {
 		dev_err(ab8500->dev, "Failed to create irqdomain\n");
-		return -ENOSYS;
+		return -ENODEV;
 	}
 
 	return 0;
@@ -1549,7 +1545,7 @@ static struct attribute_group ab9540_attr_group = {
 
 static int ab8500_probe(struct platform_device *pdev)
 {
-	static const char *switch_off_status[] = {
+	static const char * const switch_off_status[] = {
 		"Swoff bit programming",
 		"Thermal protection activation",
 		"Vbat lower then BattOk falling threshold",
@@ -1558,7 +1554,7 @@ static int ab8500_probe(struct platform_device *pdev)
 		"Battery level lower than power on reset threshold",
 		"Power on key 1 pressed longer than 10 seconds",
 		"DB8500 thermal shutdown"};
-	static const char *turn_on_status[] = {
+	static const char * const turn_on_status[] = {
 		"Battery rising (Vbat)",
 		"Power On Key 1 dbF",
 		"Power On Key 2 dbF",
-- 
1.9.1


  parent reply	other threads:[~2015-12-07 11:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-07 11:50 [PATCH 00/19] mfd: Lots of clean-ups Lee Jones
2015-12-07 11:50 ` [PATCH 01/19] mfd: aat2870-core: Remove unnecessary 'out of memory' message Lee Jones
2015-12-07 11:50 ` [PATCH 02/19] mfd: ab3100-core.c: Fix multiple warnings reported by Checkpatch Lee Jones
2015-12-07 11:50 ` [PATCH 03/19] mfd: ab2100-otp: Remove pointless 'out of memory' error message Lee Jones
2015-12-07 11:50 ` Lee Jones [this message]
2015-12-07 11:50 ` [PATCH 05/19] mfd: ab8500-debugfs: Clean-up non-conforming commenting and print formatting Lee Jones
2015-12-07 11:50 ` [PATCH 06/19] mfd: ab8500-gpadc: Squash a whole bunch of Checkpatch warnings and one error Lee Jones
2015-12-07 11:50 ` [PATCH 07/19] mfd: ab8500-sysctrl: Fix Constify, printk => pr_info and formatting issues Lee Jones
2015-12-07 11:50 ` [PATCH 08/19] mfd: adp5520: Some trivial 'no space before tab' fixes Lee Jones
2015-12-07 11:50 ` [PATCH 09/19] mfd: arizona-core: msleep() is unreliable for anything <20ms use usleep_range() instead Lee Jones
2015-12-08 14:33   ` Charles Keepax
2015-12-08 15:45     ` Lee Jones
2015-12-07 11:50 ` [PATCH 10/19] mfd: arizona-i2c: Add blank line formatting after declaration Lee Jones
2015-12-08 14:33   ` Charles Keepax
2015-12-07 11:50 ` [PATCH 11/19] mfd: as3711: Repair OOM and 'line over 80 chars' formatting warnings Lee Jones
2015-12-07 11:50 ` [PATCH 12/19] mfd: asic3: Fix a plethora of Checkpatch errors and warnings Lee Jones
2015-12-07 11:50 ` [PATCH 13/19] mfd: cros_ec_i2c: Fix trivial 'tabs before spaces' whitespace issue Lee Jones
2015-12-07 11:50 ` [PATCH 14/19] mfd: cros_ec_spi: Repair comparison ordering issue Lee Jones
2015-12-07 11:50 ` [PATCH 15/19] mfd: cs5535-mfd: Add missing line spacing and make local array static Lee Jones
2015-12-07 11:50 ` [PATCH 16/19] mfd: da903x: Fix white space and split string issues Lee Jones
2015-12-07 11:50 ` [PATCH 17/19] mfd: da9052-i2c: Fix tabbing/whitespace issue Lee Jones
2015-12-07 11:50 ` [PATCH 18/19] mfd: da9052-irq: Fix trivial 'space before comma' error Lee Jones
2015-12-07 11:50 ` [PATCH 19/19] mfd: davinci_voicecodec: Remove pointless 'out of memory' error message Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449489032-14374-5-git-send-email-lee.jones@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).