Skip to contentSkip to conversation

i2c: aspeed: Add an explicit type casting for *get_clk_reg_val

PATCH In review Jae Hyun Yoo 3 participants 4 messages Jul 24, 2018 – Aug 4, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 i2c: aspeed: Add an explicit type casting for *get_clk_reg_val

This commit fixes this sparse warning:
drivers/i2c/busses/i2c-aspeed.c:875:38: warning: incorrect type in assignment (different modifiers)
drivers/i2c/busses/i2c-aspeed.c:875:38: expected unsigned int ( *get_clk_reg_val )( ... )
drivers/i2c/busses/i2c-aspeed.c:875:38: got void const *const data

---
Changes since v1:
- Fixed title and added Reported-by tag.

 drivers/i2c/busses/i2c-aspeed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-aspeed.c +1 -1
index efb89422d496..a4f956c6d567 100644
@@ -872,7 +872,7 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
 	if (!match)
 		bus->get_clk_reg_val = aspeed_i2c_24xx_get_clk_reg_val;
 	else
-		bus->get_clk_reg_val = match->data;
+		bus->get_clk_reg_val = (u32 (*)(u32))match->data;
 
 	/* Initialize the I2C adapter */
 	spin_lock_init(&bus->lock);
Signature · 1 line
2.18.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 28 lines · Jae Hyun Yoo

This commit fixes this sparse warning:
drivers/i2c/busses/i2c-aspeed.c:875:38: warning: incorrect type in assignment (different modifiers)
drivers/i2c/busses/i2c-aspeed.c:875:38: expected unsigned int ( *get_clk_reg_val )( ... )
drivers/i2c/busses/i2c-aspeed.c:875:38: got void const *const data

---
Changes since v1:
- Fixed title and added Reported-by tag.

 drivers/i2c/busses/i2c-aspeed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-aspeed.c +1 -2
index efb89422d496..a4f956c6d567 100644
@@ -872,7 +872,7 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
        if (!match)
                bus->get_clk_reg_val = aspeed_i2c_24xx_get_clk_reg_val;
        else
-               bus->get_clk_reg_val = match->data;
+               bus->get_clk_reg_val = (u32 (*)(u32))match->data;
 
        /* Initialize the I2C adapter */
        spin_lock_init(&bus->lock);
--
Quoted 2 lines

2.18.0

#2 lore raw
Quoted 27 lines · Brendan Higgins
Quoted 25 lines · Jae Hyun Yoo

This commit fixes this sparse warning:
drivers/i2c/busses/i2c-aspeed.c:875:38: warning: incorrect type in assignment (different modifiers)
drivers/i2c/busses/i2c-aspeed.c:875:38: expected unsigned int ( *get_clk_reg_val )( ... )
drivers/i2c/busses/i2c-aspeed.c:875:38: got void const *const data

---
Changes since v1:
- Fixed title and added Reported-by tag.

  drivers/i2c/busses/i2c-aspeed.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-aspeed.c +1 -1
index efb89422d496..a4f956c6d567 100644
@@ -872,7 +872,7 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
         if (!match)
                 bus->get_clk_reg_val = aspeed_i2c_24xx_get_clk_reg_val;
         else
-               bus->get_clk_reg_val = match->data;
+               bus->get_clk_reg_val = (u32 (*)(u32))match->data;
 
Quoted 8 lines
Quoted 5 lines
drivers/i2c/busses/i2c-aspeed.c +0 -1
         /* Initialize the I2C adapter */
         spin_lock_init(&bus->lock);
--

2.18.0

Thanks a lot Brendan for your review!

Hi Wolfram,

I forgot adding 'Reported-by: Wolfram Sang <[email protected]>'. Please add this tag when you apply this patch, or let me know if I need to submit v3 for adding the tag.

Thanks,

Jae

#3 lore raw
In reply to Jae Hyun Yoo
Quoted 6 lines · Jae Hyun Yoo

This commit fixes this sparse warning:
drivers/i2c/busses/i2c-aspeed.c:875:38: warning: incorrect type in assignment (different modifiers)
drivers/i2c/busses/i2c-aspeed.c:875:38: expected unsigned int ( *get_clk_reg_val )( ... )
drivers/i2c/busses/i2c-aspeed.c:875:38: got void const *const data

Added the 'Reported-tag' and applied to for-next, thanks!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180804/01f720dc/attachment.sig>