Re: [PATCH 1/1] drivers: i2c: silence a compile warning in i2c-s3c2410.c

2014-01-14 Thread Wolfram Sang
On Fri, Jan 10, 2014 at 12:03:45PM +0900, Pankaj Dubey wrote:
 If used 64 bit compiler GCC warns that:
 
 drivers/i2c/busses/i2c-s3c2410.c: In function ‘s3c24xx_get_device_quirks’:
 drivers/i2c/busses/i2c-s3c2410.c:168:10: warning: cast from pointer to integer
 of different size [-Wpointer-to-int-cast]
 
 This patch fixes this by converting unsigned int to unsigned long.

Maybe switch to kernel_ulong_t? Since this is used in mod_devicetable.h
all over.

 
 CC: Kukjin Kim kgene@samsung.com
 CC: Wolfram Sang w...@the-dreams.de
 CC: linux-...@vger.kernel.org
 Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
 ---
  drivers/i2c/busses/i2c-s3c2410.c |7 ---
  1 file changed, 4 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/i2c/busses/i2c-s3c2410.c 
 b/drivers/i2c/busses/i2c-s3c2410.c
 index bf8fb94..447dd98 100644
 --- a/drivers/i2c/busses/i2c-s3c2410.c
 +++ b/drivers/i2c/busses/i2c-s3c2410.c
 @@ -101,7 +101,7 @@ enum s3c24xx_i2c_state {
  
  struct s3c24xx_i2c {
   wait_queue_head_t   wait;
 - unsigned intquirks;
 + unsigned longquirks;

The indentation is corrupted.

   unsigned intsuspended:1;
  
   struct i2c_msg  *msg;
 @@ -160,12 +160,13 @@ MODULE_DEVICE_TABLE(of, s3c24xx_i2c_match);
   * Get controller type either from device tree or platform device variant.
  */
  
 -static inline unsigned int s3c24xx_get_device_quirks(struct platform_device 
 *pdev)
 +static inline unsigned long
 + s3c24xx_get_device_quirks(struct platform_device *pdev)

Keep it one line please, ignoring the 80 char thing.

  {
   if (pdev-dev.of_node) {
   const struct of_device_id *match;
   match = of_match_node(s3c24xx_i2c_match, pdev-dev.of_node);
 - return (unsigned int)match-data;
 + return (unsigned long)match-data;
   }
  
   return platform_get_device_id(pdev)-driver_data;

The last line also returns kernel_ulong_t. No real difference, but using
it is a little more consistent.



signature.asc
Description: Digital signature


[PATCH 1/1] drivers: i2c: silence a compile warning in i2c-s3c2410.c

2014-01-09 Thread Pankaj Dubey
If used 64 bit compiler GCC warns that:

drivers/i2c/busses/i2c-s3c2410.c: In function ‘s3c24xx_get_device_quirks’:
drivers/i2c/busses/i2c-s3c2410.c:168:10: warning: cast from pointer to integer
of different size [-Wpointer-to-int-cast]

This patch fixes this by converting unsigned int to unsigned long.

CC: Kukjin Kim kgene@samsung.com
CC: Wolfram Sang w...@the-dreams.de
CC: linux-...@vger.kernel.org
Signed-off-by: Pankaj Dubey pankaj.du...@samsung.com
---
 drivers/i2c/busses/i2c-s3c2410.c |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index bf8fb94..447dd98 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -101,7 +101,7 @@ enum s3c24xx_i2c_state {
 
 struct s3c24xx_i2c {
wait_queue_head_t   wait;
-   unsigned intquirks;
+   unsigned longquirks;
unsigned intsuspended:1;
 
struct i2c_msg  *msg;
@@ -160,12 +160,13 @@ MODULE_DEVICE_TABLE(of, s3c24xx_i2c_match);
  * Get controller type either from device tree or platform device variant.
 */
 
-static inline unsigned int s3c24xx_get_device_quirks(struct platform_device 
*pdev)
+static inline unsigned long
+   s3c24xx_get_device_quirks(struct platform_device *pdev)
 {
if (pdev-dev.of_node) {
const struct of_device_id *match;
match = of_match_node(s3c24xx_i2c_match, pdev-dev.of_node);
-   return (unsigned int)match-data;
+   return (unsigned long)match-data;
}
 
return platform_get_device_id(pdev)-driver_data;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html