* [PATCH 0/2] Fix warnings for i2c-rk3x.c
@ 2016-09-22 11:29 David Wu
2016-09-22 11:29 ` [PATCH 1/2] i2c: rk3x: Fix sparse warning David Wu
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: David Wu @ 2016-09-22 11:29 UTC (permalink / raw)
To: heiko, wsa
Cc: dianders, huangtao, wxt, linux-arm-kernel, linux-rockchip,
linux-i2c, devicetree, linux-kernel, David Wu
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] i2c: rk3x: Fix sparse warning
2016-09-22 11:29 [PATCH 0/2] Fix warnings for i2c-rk3x.c David Wu
@ 2016-09-22 11:29 ` David Wu
2016-09-22 11:29 ` [PATCH 2/2] i2c: rk3x: Fix variable 'min_total_ns' unused warning David Wu
2016-09-22 17:52 ` [PATCH 0/2] Fix warnings for i2c-rk3x.c Wolfram Sang
2 siblings, 0 replies; 4+ messages in thread
From: David Wu @ 2016-09-22 11:29 UTC (permalink / raw)
To: heiko, wsa
Cc: dianders, huangtao, wxt, linux-arm-kernel, linux-rockchip,
linux-i2c, devicetree, linux-kernel, David Wu
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] i2c: rk3x: Fix variable 'min_total_ns' unused warning
2016-09-22 11:29 [PATCH 0/2] Fix warnings for i2c-rk3x.c David Wu
2016-09-22 11:29 ` [PATCH 1/2] i2c: rk3x: Fix sparse warning David Wu
@ 2016-09-22 11:29 ` David Wu
2016-09-22 17:52 ` [PATCH 0/2] Fix warnings for i2c-rk3x.c Wolfram Sang
2 siblings, 0 replies; 4+ messages in thread
From: David Wu @ 2016-09-22 11:29 UTC (permalink / raw)
To: heiko, wsa
Cc: dianders, huangtao, wxt, linux-arm-kernel, linux-rockchip,
linux-i2c, devicetree, linux-kernel, David Wu
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] Fix warnings for i2c-rk3x.c
2016-09-22 11:29 [PATCH 0/2] Fix warnings for i2c-rk3x.c David Wu
2016-09-22 11:29 ` [PATCH 1/2] i2c: rk3x: Fix sparse warning David Wu
2016-09-22 11:29 ` [PATCH 2/2] i2c: rk3x: Fix variable 'min_total_ns' unused warning David Wu
@ 2016-09-22 17:52 ` Wolfram Sang
2 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2016-09-22 17:52 UTC (permalink / raw)
To: David Wu
Cc: heiko, dianders, huangtao, wxt, linux-arm-kernel, linux-rockchip,
linux-i2c, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 208 bytes --]
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!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-22 17:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-22 11:29 [PATCH 0/2] Fix warnings for i2c-rk3x.c David Wu
2016-09-22 11:29 ` [PATCH 1/2] i2c: rk3x: Fix sparse warning David Wu
2016-09-22 11:29 ` [PATCH 2/2] i2c: rk3x: Fix variable 'min_total_ns' unused warning David Wu
2016-09-22 17:52 ` [PATCH 0/2] Fix warnings for i2c-rk3x.c Wolfram Sang
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).