From: Wolfram Sang <wsa@the-dreams.de>
To: Pankaj Dubey <pankaj.dubey@samsung.com>
Cc: linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Kukjin Kim <kgene.kim@samsung.com>,
linux-i2c@vger.kernel.org
Subject: Re: [PATCH 1/1] drivers: i2c: silence a compile warning in i2c-s3c2410.c
Date: Tue, 14 Jan 2014 20:09:10 +0100 [thread overview]
Message-ID: <20140114190910.GE10340@katana> (raw)
In-Reply-To: <1389323025-4478-1-git-send-email-pankaj.dubey@samsung.com>
[-- Attachment #1: Type: text/plain, Size: 2059 bytes --]
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.kim@samsung.com>
> CC: Wolfram Sang <wsa@the-dreams.de>
> CC: linux-i2c@vger.kernel.org
> Signed-off-by: Pankaj Dubey <pankaj.dubey@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 int quirks;
> + unsigned long quirks;
The indentation is corrupted.
> unsigned int suspended: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.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-01-14 19:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-10 3:03 [PATCH 1/1] drivers: i2c: silence a compile warning in i2c-s3c2410.c Pankaj Dubey
2014-01-14 19:09 ` Wolfram Sang [this message]
2014-01-15 1:42 ` [PATCH v2] " y
[not found] ` <1389750162-5765-1-git-send-email-y-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-01-16 10:21 ` Wolfram Sang
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=20140114190910.GE10340@katana \
--to=wsa@the-dreams.de \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=pankaj.dubey@samsung.com \
/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).