All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <m.chehab@samsung.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: kbuild test robot <fengguang.wu@intel.com>,
	Andrzej Hajda <a.hajda@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	kbuild-all@01.org, linux-media@vger.kernel.org
Subject: Re: [kbuild-all] [linuxtv-media:master 499/499] drivers/media/i2c/s5k5baf.c:362:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t'
Date: Wed, 08 Jan 2014 10:21:10 -0200	[thread overview]
Message-ID: <20140108102110.1a79579a@samsung.com> (raw)
In-Reply-To: <20140108083736.GA27840@mwanda>

Em Wed, 8 Jan 2014 11:37:37 +0300
Dan Carpenter <dan.carpenter@oracle.com> escreveu:

> The other thing that concerned me with this was the sparse warning:
> 
> drivers/media/i2c/s5k5baf.c:481:26: error: bad constant expression

Hmm...
	static void s5k5baf_write_arr_seq(struct s5k5baf *state, u16 addr,
	                                  u16 count, const u16 *seq)
	{
	        struct i2c_client *c = v4l2_get_subdevdata(&state->sd);
	        __be16 buf[count + 1];
	        int ret, n;

Yeah, allocating data like that at stack is not nice.

I would simply replace the static allocation here by a dynamic one.
 
> It was hard to verify that this couldn't go over 512.  I guess 512 is
> what we would consider an error in this context.  This seems like it
> could be determined by the firmware?
> 
> regards,
> dan carpenter
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 

Cheers,
Mauro

  reply	other threads:[~2014-01-08 12:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-24  8:22 [linuxtv-media:master 499/499] drivers/media/i2c/s5k5baf.c:362:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' kbuild test robot
2014-01-08  8:37 ` [kbuild-all] " Dan Carpenter
2014-01-08 12:21   ` Mauro Carvalho Chehab [this message]
2014-01-08 13:33     ` Andrzej Hajda
2014-01-08 14:27       ` Mauro Carvalho Chehab
2014-01-09 12:55         ` [PATCH] s5k5baf: allow to handle arbitrary long i2c sequences Andrzej Hajda
2014-01-08 12:23   ` [kbuild-all] [linuxtv-media:master 499/499] drivers/media/i2c/s5k5baf.c:362:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' Andrzej Hajda

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=20140108102110.1a79579a@samsung.com \
    --to=m.chehab@samsung.com \
    --cc=a.hajda@samsung.com \
    --cc=dan.carpenter@oracle.com \
    --cc=fengguang.wu@intel.com \
    --cc=kbuild-all@01.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=s.nawrocki@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 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.