public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Input: cyttsp4 - SPI driver for Cypress TMA4XX touchscreen devices
       [not found] <20130704235117.733726609A1@gitolite.kernel.org>
@ 2013-07-07 19:15 ` Geert Uytterhoeven
  2013-07-09  7:12   ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2013-07-07 19:15 UTC (permalink / raw)
  To: Ferruh Yigit, Javier Martinez Canillas, Dmitry Torokhov
  Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org

On Fri, Jul 5, 2013 at 1:51 AM, Linux Kernel Mailing List
<linux-kernel@vger.kernel.org> wrote:
> +++ b/drivers/input/touchscreen/cyttsp4_spi.c

> +static int cyttsp_spi_xfer(struct device *dev, u8 *xfer_buf,
> +                          u8 op, u8 reg, u8 *buf, int length)
> +{

> +       if (reg > 255)

As "reg" is "u8", this is never true:

drivers/input/touchscreen/cyttsp4_spi.c: In function ‘cyttsp_spi_xfer’:
drivers/input/touchscreen/cyttsp4_spi.c:66: warning: comparison is
always false due to limited range of data type

> +               wr_buf[0] = op + CY_SPI_A8_BIT;
> +       else
> +               wr_buf[0] = op;

Can the if-clause and the first branch just be removed, or is there a real bug
involved (e.g. wrong type for "reg")?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Input: cyttsp4 - SPI driver for Cypress TMA4XX touchscreen devices
  2013-07-07 19:15 ` Input: cyttsp4 - SPI driver for Cypress TMA4XX touchscreen devices Geert Uytterhoeven
@ 2013-07-09  7:12   ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2013-07-09  7:12 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Javier Martinez Canillas, Dmitry Torokhov,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org

On 07/07/2013 10:15 PM, Geert Uytterhoeven wrote:
> On Fri, Jul 5, 2013 at 1:51 AM, Linux Kernel Mailing List
> <linux-kernel@vger.kernel.org> wrote:
>> +++ b/drivers/input/touchscreen/cyttsp4_spi.c
>
>> +static int cyttsp_spi_xfer(struct device *dev, u8 *xfer_buf,
>> +                          u8 op, u8 reg, u8 *buf, int length)
>> +{
>
>> +       if (reg > 255)
>
> As "reg" is "u8", this is never true:
>
> drivers/input/touchscreen/cyttsp4_spi.c: In function ‘cyttsp_spi_xfer’:
> drivers/input/touchscreen/cyttsp4_spi.c:66: warning: comparison is
> always false due to limited range of data type
>
>> +               wr_buf[0] = op + CY_SPI_A8_BIT;
>> +       else
>> +               wr_buf[0] = op;
>
> Can the if-clause and the first branch just be removed, or is there a real bug
> involved (e.g. wrong type for "reg")?

Yes there was a bug here, and already sent a patch for this, please
check https://patchwork.kernel.org/patch/2820561/

thanks,
ferruh


This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-09  7:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20130704235117.733726609A1@gitolite.kernel.org>
2013-07-07 19:15 ` Input: cyttsp4 - SPI driver for Cypress TMA4XX touchscreen devices Geert Uytterhoeven
2013-07-09  7:12   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox