linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiubo Li <lixiubo@cmss.chinamobile.com>
To: broonie@kernel.org
Cc: linux-kernel@vger.kernel.org, Xiubo Li <lixiubo@cmss.chinamobile.com>
Subject: [PATCH 1/3] regmap: cache: Tidy up the code to suppress style check warnings
Date: Thu,  3 Dec 2015 17:31:51 +0800	[thread overview]
Message-ID: <1449135113-31892-2-git-send-email-lixiubo@cmss.chinamobile.com> (raw)
In-Reply-To: <1449135113-31892-1-git-send-email-lixiubo@cmss.chinamobile.com>

There will be some warning like the following when checking new
patches near this code:
    "WARNING: Missing a blank line after declarations"
This patch will suppress this warning.

Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
---
 drivers/base/regmap/regcache.c | 36 ++++++++++++------------------------
 1 file changed, 12 insertions(+), 24 deletions(-)

diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 4c07802..0905562 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -533,21 +533,15 @@ bool regcache_set_val(struct regmap *map, void *base, unsigned int idx,
 	}
 
 	switch (map->cache_word_size) {
-	case 1: {
-		u8 *cache = base;
-		cache[idx] = val;
+	case 1:
+		((u8 *)base)[idx] = val;
 		break;
-	}
-	case 2: {
-		u16 *cache = base;
-		cache[idx] = val;
+	case 2:
+		((u16 *)base)[idx] = val;
 		break;
-	}
-	case 4: {
-		u32 *cache = base;
-		cache[idx] = val;
+	case 4:
+		((u32 *)base)[idx] = val;
 		break;
-	}
 	default:
 		BUG();
 	}
@@ -566,18 +560,12 @@ unsigned int regcache_get_val(struct regmap *map, const void *base,
 								   idx));
 
 	switch (map->cache_word_size) {
-	case 1: {
-		const u8 *cache = base;
-		return cache[idx];
-	}
-	case 2: {
-		const u16 *cache = base;
-		return cache[idx];
-	}
-	case 4: {
-		const u32 *cache = base;
-		return cache[idx];
-	}
+	case 1:
+		return ((u8 *)base)[idx];
+	case 2:
+		return ((u16 *)base)[idx];
+	case 4:
+		return ((u32 *)base)[idx];
 	default:
 		BUG();
 	}
-- 
1.8.3.1



  reply	other threads:[~2015-12-03  9:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-03  9:31 [PATCH 0/3] regmap: add 64-bit support Xiubo Li
2015-12-03  9:31 ` Xiubo Li [this message]
2015-12-08 17:12   ` [PATCH 1/3] regmap: cache: Tidy up the code to suppress style check warnings Mark Brown
2015-12-09  3:30     ` [PATCH 1/3] regmap: cache: Tidy up the code to suppress stylecheck warnings Xiubo Li
2015-12-03  9:31 ` [PATCH 2/3] regmap: add 64-bit mode support Xiubo Li
2015-12-08 19:11   ` Applied "regmap: add 64-bit mode support" to the regmap tree Mark Brown
2015-12-09  8:45   ` [PATCH 2/3] regmap: add 64-bit mode support Arnd Bergmann
2015-12-09  9:01     ` Xiubo Li
2015-12-03  9:31 ` [PATCH 3/3] regcache: " Xiubo Li

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=1449135113-31892-2-git-send-email-lixiubo@cmss.chinamobile.com \
    --to=lixiubo@cmss.chinamobile.com \
    --cc=broonie@kernel.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).