All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Hans Verkuil <hverkuil@xs4all.nl>, linux-media@vger.kernel.org
Cc: Hans Verkuil <hans.verkuil@cisco.com>,
	Andrzej Hajda <a.hajda@samsung.com>
Subject: Re: [PATCH 10/10] s5k5baf: fix sparse warnings
Date: Mon, 15 Dec 2014 11:59:33 +0100	[thread overview]
Message-ID: <548EBF15.3060902@samsung.com> (raw)
In-Reply-To: <1418471580-26510-11-git-send-email-hverkuil@xs4all.nl>

On 13/12/14 12:53, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> drivers/media/i2c/s5k5baf.c:1796:33: warning: duplicate const
> drivers/media/i2c/s5k5baf.c:379:24: warning: cast to restricted __le16
> drivers/media/i2c/s5k5baf.c:437:11: warning: incorrect type in assignment (different base types)
> drivers/media/i2c/s5k5baf.c:445:16: warning: incorrect type in return expression (different base types)
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

> ---
>  drivers/media/i2c/s5k5baf.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c
> index 60a74d8..a3d7d03 100644
> --- a/drivers/media/i2c/s5k5baf.c
> +++ b/drivers/media/i2c/s5k5baf.c
> @@ -353,7 +353,7 @@ static struct v4l2_rect s5k5baf_cis_rect = {
>   *
>   */
>  static int s5k5baf_fw_parse(struct device *dev, struct s5k5baf_fw **fw,
> -			    size_t count, const u16 *data)
> +			    size_t count, const __le16 *data)
>  {
>  	struct s5k5baf_fw *f;
>  	u16 *d, i, *end;
> @@ -421,6 +421,7 @@ static u16 s5k5baf_i2c_read(struct s5k5baf *state, u16 addr)
>  {
>  	struct i2c_client *c = v4l2_get_subdevdata(&state->sd);
>  	__be16 w, r;
> +	u16 res;
>  	struct i2c_msg msg[] = {
>  		{ .addr = c->addr, .flags = 0,
>  		  .len = 2, .buf = (u8 *)&w },
> @@ -434,15 +435,15 @@ static u16 s5k5baf_i2c_read(struct s5k5baf *state, u16 addr)
>  
>  	w = cpu_to_be16(addr);
>  	ret = i2c_transfer(c->adapter, msg, 2);
> -	r = be16_to_cpu(r);
> +	res = be16_to_cpu(r);
>  
> -	v4l2_dbg(3, debug, c, "i2c_read: 0x%04x : 0x%04x\n", addr, r);
> +	v4l2_dbg(3, debug, c, "i2c_read: 0x%04x : 0x%04x\n", addr, res);
>  
>  	if (ret != 2) {
>  		v4l2_err(c, "i2c_read: error during transfer (%d)\n", ret);
>  		state->error = ret;
>  	}
> -	return r;
> +	return res;
>  }
>  
>  static void s5k5baf_i2c_write(struct s5k5baf *state, u16 addr, u16 val)
> @@ -1037,7 +1038,7 @@ static int s5k5baf_load_setfile(struct s5k5baf *state)
>  	}
>  
>  	ret = s5k5baf_fw_parse(&c->dev, &state->fw, fw->size / 2,
> -			       (u16 *)fw->data);
> +			       (__le16 *)fw->data);
>  
>  	release_firmware(fw);
>  
> @@ -1793,7 +1794,7 @@ static const struct v4l2_subdev_ops s5k5baf_subdev_ops = {
>  
>  static int s5k5baf_configure_gpios(struct s5k5baf *state)
>  {
> -	static const char const *name[] = { "S5K5BAF_STBY", "S5K5BAF_RST" };
> +	static const char * const name[] = { "S5K5BAF_STBY", "S5K5BAF_RST" };
>  	struct i2c_client *c = v4l2_get_subdevdata(&state->sd);
>  	struct s5k5baf_gpio *g = state->gpios;
>  	int ret, i;


      reply	other threads:[~2014-12-15 10:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-13 11:52 [PATCH 00/10] Sparse fixes Hans Verkuil
2014-12-13 11:52 ` [PATCH 01/10] av7110: fix sparse warning Hans Verkuil
2014-12-13 11:52 ` [PATCH 02/10] budget-core: fix sparse warnings Hans Verkuil
2014-12-13 11:52 ` [PATCH 03/10] ivtv: fix sparse warning Hans Verkuil
2014-12-13 11:52 ` [PATCH 04/10] videobuf2-vmalloc: " Hans Verkuil
2014-12-13 11:52 ` [PATCH 05/10] media-entity: fix sparse warnings Hans Verkuil
2014-12-13 12:08   ` Sakari Ailus
2014-12-13 11:52 ` [PATCH 06/10] hd29l2: fix sparse error and warnings Hans Verkuil
2014-12-13 13:25   ` Antti Palosaari
2014-12-13 11:52 ` [PATCH 07/10] m5mols: fix sparse warnings Hans Verkuil
2014-12-15 10:56   ` Sylwester Nawrocki
2014-12-13 11:52 ` [PATCH 08/10] s5k4ecgx: " Hans Verkuil
2014-12-15 10:56   ` Sylwester Nawrocki
2014-12-13 11:52 ` [PATCH 09/10] s5k6aa: " Hans Verkuil
2014-12-15 10:58   ` Sylwester Nawrocki
2014-12-13 11:53 ` [PATCH 10/10] s5k5baf: " Hans Verkuil
2014-12-15 10:59   ` Sylwester Nawrocki [this message]

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=548EBF15.3060902@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=a.hajda@samsung.com \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.