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


Groups > linux.kernel > #1488799 > unrolled thread

[PATCH 0/2] Fix warnings for i2c-rk3x.c

Started byDavid Wu <david.wu@rock-chips.com>
First post2016-09-22 13:40 +0200
Last post2016-09-22 20:00 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/2] Fix warnings for i2c-rk3x.c David Wu <david.wu@rock-chips.com> - 2016-09-22 13:40 +0200
    [PATCH 1/2] i2c: rk3x: Fix sparse warning David Wu <david.wu@rock-chips.com> - 2016-09-22 13:40 +0200
    [PATCH 2/2] i2c: rk3x: Fix variable 'min_total_ns' unused warning David Wu <david.wu@rock-chips.com> - 2016-09-22 13:40 +0200
    Re: [PATCH 0/2] Fix warnings for i2c-rk3x.c Wolfram Sang <wsa@the-dreams.de> - 2016-09-22 20:00 +0200

#1488799 — [PATCH 0/2] Fix warnings for i2c-rk3x.c

FromDavid Wu <david.wu@rock-chips.com>
Date2016-09-22 13:40 +0200
Subject[PATCH 0/2] Fix warnings for i2c-rk3x.c
Message-ID<skawa-5IH-13@gated-at.bofh.it>
David Wu (2):
  i2c: rk3x: Fix sparse warning
  i2c: rk3x: fix variable 'min_total_ns' unused warning

 drivers/i2c/busses/i2c-rk3x.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

-- 
1.9.1

[toc] | [next] | [standalone]


#1488800 — [PATCH 1/2] i2c: rk3x: Fix sparse warning

FromDavid Wu <david.wu@rock-chips.com>
Date2016-09-22 13:40 +0200
Subject[PATCH 1/2] i2c: rk3x: Fix sparse warning
Message-ID<skawa-5IH-21@gated-at.bofh.it>
In reply to#1488799
This patch fixes the following sparse warning:
drivers/i2c/busses/i2c-rk3x.c:888:17: warning: cast truncates bits from constant value (ffffffffff00 becomes ffffff00)

Signed-off-by: David Wu <david.wu@rock-chips.com>
---
 drivers/i2c/busses/i2c-rk3x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
index f2d0148..965477e 100644
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -58,7 +58,7 @@ enum {
 #define REG_CON_LASTACK   BIT(5) /* 1: send NACK after last received byte */
 #define REG_CON_ACTACK    BIT(6) /* 1: stop if NACK is received */
 
-#define REG_CON_TUNING_MASK GENMASK(15, 8)
+#define REG_CON_TUNING_MASK GENMASK_ULL(15, 8)
 
 #define REG_CON_SDA_CFG(cfg) ((cfg) << 8)
 #define REG_CON_STA_CFG(cfg) ((cfg) << 12)
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1488802 — [PATCH 2/2] i2c: rk3x: Fix variable 'min_total_ns' unused warning

FromDavid Wu <david.wu@rock-chips.com>
Date2016-09-22 13:40 +0200
Subject[PATCH 2/2] i2c: rk3x: Fix variable 'min_total_ns' unused warning
Message-ID<skawa-5IH-17@gated-at.bofh.it>
In reply to#1488799
This patch fixs the following warning:
drivers/i2c/busses/i2c-rk3x.c: In function 'rk3x_i2c_v1_calc_timings':
drivers/i2c/busses/i2c-rk3x.c:745:41: warning: variable 'min_total_ns' set but not used [-Wunused-but-set-variable]

Signed-off-by: David Wu <david.wu@rock-chips.com>
---
 drivers/i2c/busses/i2c-rk3x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
index 965477e..50702c7 100644
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -742,7 +742,7 @@ static int rk3x_i2c_v1_calc_timings(unsigned long clk_rate,
 				    struct i2c_timings *t,
 				    struct rk3x_i2c_calced_timings *t_calc)
 {
-	unsigned long min_low_ns, min_high_ns, min_total_ns;
+	unsigned long min_low_ns, min_high_ns;
 	unsigned long min_setup_start_ns, min_setup_data_ns;
 	unsigned long min_setup_stop_ns, max_hold_data_ns;
 
@@ -793,7 +793,6 @@ static int rk3x_i2c_v1_calc_timings(unsigned long clk_rate,
 
 	/* These are the min dividers needed for min hold times. */
 	min_div_for_hold = (min_low_div + min_high_div);
-	min_total_ns = min_low_ns + min_high_ns;
 
 	/*
 	 * This is the maximum divider so we don't go over the maximum.
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1489253

FromWolfram Sang <wsa@the-dreams.de>
Date2016-09-22 20:00 +0200
Message-ID<skgrV-10r-87@gated-at.bofh.it>
In reply to#1488799

[Multipart message — attachments visible in raw view] — view raw

On Thu, Sep 22, 2016 at 07:29:22PM +0800, David Wu wrote:
> David Wu (2):
>   i2c: rk3x: Fix sparse warning
>   i2c: rk3x: fix variable 'min_total_ns' unused warning
> 

Applied to for-next, thanks!

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web