All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: Irina Tirdea <irina.tirdea@intel.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Pawel Moll <pawel.moll@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>
Subject: Re: [PATCH v2 2/8] input: goodix: fix variable length array warning
Date: Tue, 09 Jun 2015 17:35:44 +0200	[thread overview]
Message-ID: <1433864144.5707.5.camel@hadess.net> (raw)
In-Reply-To: <1433774273-23103-3-git-send-email-irina.tirdea@intel.com>

On Mon, 2015-06-08 at 17:37 +0300, Irina Tirdea wrote:
> Fix sparse warning:
> drivers/input/touchscreen/goodix.c:182:26: warning:
> Variable length array is used.
> 
> Replace the variable length array with fixed length.
> 
> Some Goodix devices have maximum 5 touch points, while
> others have 10 touch points. Using the maximum length
> (80 bytes) for all devices will lead to wasting 40 bytes
> when using devices with maximum 5 touch points. However,
> that is prefferable to using kmalloc which will use even
          ^^^^^^^^^^^
preferable

> more resources.
> 
> Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>

Acked-by: Bastien Nocera <hadess@hadess.net>

> ---
>  drivers/input/touchscreen/goodix.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/goodix.c 
> b/drivers/input/touchscreen/goodix.c
> index a65e4d9..18557e4 100644
> --- a/drivers/input/touchscreen/goodix.c
> +++ b/drivers/input/touchscreen/goodix.c
> @@ -147,7 +147,7 @@ static void goodix_ts_report_touch(struct 
> goodix_ts_data *ts, u8 *coor_data)
>   */
>  static void goodix_process_events(struct goodix_ts_data *ts)
>  {
> -     u8  point_data[1 + GOODIX_CONTACT_SIZE * ts->max_touch_num];
> +     u8  point_data[1 + GOODIX_CONTACT_SIZE * 
> GOODIX_MAX_CONTACTS];
>       int touch_num;
>       int i;
>  

  reply	other threads:[~2015-06-09 15:35 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08 14:37 [PATCH v2 0/8] Goodix touchscreen enhancements Irina Tirdea
2015-06-08 14:37 ` [PATCH v2 2/8] input: goodix: fix variable length array warning Irina Tirdea
2015-06-09 15:35   ` Bastien Nocera [this message]
2015-06-08 14:37 ` [PATCH v2 3/8] input: goodix: export id and version read from device Irina Tirdea
2015-06-09 15:36   ` Bastien Nocera
     [not found] ` <1433774273-23103-1-git-send-email-irina.tirdea-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-06-08 14:37   ` [PATCH v2 1/8] input: goodix: fix alignment issues Irina Tirdea
2015-06-08 14:37     ` Irina Tirdea
2015-06-08 14:37   ` [PATCH v2 4/8] input: goodix: reset device at init Irina Tirdea
2015-06-08 14:37     ` Irina Tirdea
2015-06-09 15:34     ` Bastien Nocera
2015-06-09 15:53       ` Bastien Nocera
2015-06-23 13:23         ` Tirdea, Irina
2015-06-23 13:23           ` Tirdea, Irina
2015-06-23 14:12           ` Bastien Nocera
2015-06-23 14:50             ` Octavian Purdila
2015-06-29 16:04               ` Tirdea, Irina
2015-06-29 16:04                 ` Tirdea, Irina
2015-06-09 17:57     ` Dmitry Torokhov
2015-06-23 13:20       ` Tirdea, Irina
2015-06-23 13:20         ` Tirdea, Irina
2015-06-08 14:37   ` [PATCH v2 6/8] input: goodix: add power management support Irina Tirdea
2015-06-08 14:37     ` Irina Tirdea
2015-06-09 18:15     ` Dmitry Torokhov
2015-06-23 13:28       ` Tirdea, Irina
2015-06-08 14:37 ` [PATCH v2 5/8] input: goodix: write configuration data to device Irina Tirdea
     [not found]   ` <1433774273-23103-6-git-send-email-irina.tirdea-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-06-09 18:14     ` Dmitry Torokhov
2015-06-09 18:14       ` Dmitry Torokhov
2015-06-23 13:27       ` Tirdea, Irina
     [not found]         ` <1F3AC3675D538145B1661F571FE1805F2F06166E-pww93C2UFcwu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-06-23 18:59           ` Dmitry Torokhov
2015-06-23 18:59             ` Dmitry Torokhov
2015-06-29 16:01             ` Tirdea, Irina
2015-06-08 14:37 ` [PATCH v2 7/8] input: goodix: use goodix_i2c_write_u8 instead of i2c_master_send Irina Tirdea
2015-06-08 14:37 ` [PATCH v2 8/8] input: goodix: add support for ESD Irina Tirdea
2015-06-09 18:17 ` [PATCH v2 0/8] Goodix touchscreen enhancements Dmitry Torokhov
2015-06-23 13:18   ` Tirdea, Irina

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=1433864144.5707.5.camel@hadess.net \
    --to=hadess@hadess.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=irina.tirdea@intel.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@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.