2010-12-27 15:28:08

by David Sterba

[permalink] [raw]
Subject: [PATCH 1/3] HID: picolcd: fix misuse of logical operation in place of bitop

CC: Bruno Prémont <[email protected]>
CC: Jiri Kosina <[email protected]>
Signed-off-by: David Sterba <[email protected]>
---
drivers/hid/hid-picolcd.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-picolcd.c b/drivers/hid/hid-picolcd.c
index bc2e077..0aff3cd 100644
--- a/drivers/hid/hid-picolcd.c
+++ b/drivers/hid/hid-picolcd.c
@@ -1544,7 +1544,7 @@ static ssize_t picolcd_debug_eeprom_read(struct file *f, char __user *u,

/* prepare buffer with info about what we want to read (addr & len) */
raw_data[0] = *off & 0xff;
- raw_data[1] = (*off >> 8) && 0xff;
+ raw_data[1] = (*off >> 8) & 0xff;
raw_data[2] = s < 20 ? s : 20;
if (*off + raw_data[2] > 0xff)
raw_data[2] = 0x100 - *off;
@@ -1583,7 +1583,7 @@ static ssize_t picolcd_debug_eeprom_write(struct file *f, const char __user *u,

memset(raw_data, 0, sizeof(raw_data));
raw_data[0] = *off & 0xff;
- raw_data[1] = (*off >> 8) && 0xff;
+ raw_data[1] = (*off >> 8) & 0xff;
raw_data[2] = s < 20 ? s : 20;
if (*off + raw_data[2] > 0xff)
raw_data[2] = 0x100 - *off;
--
1.7.3.4.578.g6068a


2010-12-27 15:33:50

by David Sterba

[permalink] [raw]
Subject: Re: [PATCH 1/3] HID: picolcd: fix misuse of logical operation in place of bitop

On Monday 27 December 2010 16:27:43 David Sterba wrote:
> Re: [PATCH 1/3]
^^^
sorry, I forgot to give --no-numbered to format-patch, this is just one patch,

dave

2010-12-27 15:39:41

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH 1/3] HID: picolcd: fix misuse of logical operation in place of bitop

On Mon, 27 Dec 2010, David Sterba wrote:

> CC: Bruno Pr?mont <[email protected]>
> CC: Jiri Kosina <[email protected]>
> Signed-off-by: David Sterba <[email protected]>
> ---
> drivers/hid/hid-picolcd.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hid/hid-picolcd.c b/drivers/hid/hid-picolcd.c
> index bc2e077..0aff3cd 100644
> --- a/drivers/hid/hid-picolcd.c
> +++ b/drivers/hid/hid-picolcd.c
> @@ -1544,7 +1544,7 @@ static ssize_t picolcd_debug_eeprom_read(struct file *f, char __user *u,
>
> /* prepare buffer with info about what we want to read (addr & len) */
> raw_data[0] = *off & 0xff;
> - raw_data[1] = (*off >> 8) && 0xff;
> + raw_data[1] = (*off >> 8) & 0xff;
> raw_data[2] = s < 20 ? s : 20;
> if (*off + raw_data[2] > 0xff)
> raw_data[2] = 0x100 - *off;
> @@ -1583,7 +1583,7 @@ static ssize_t picolcd_debug_eeprom_write(struct file *f, const char __user *u,
>
> memset(raw_data, 0, sizeof(raw_data));
> raw_data[0] = *off & 0xff;
> - raw_data[1] = (*off >> 8) && 0xff;
> + raw_data[1] = (*off >> 8) & 0xff;
> raw_data[2] = s < 20 ? s : 20;
> if (*off + raw_data[2] > 0xff)
> raw_data[2] = 0x100 - *off;

Applied, thank you.

--
Jiri Kosina
SUSE Labs, Novell Inc.

2010-12-27 21:48:34

by Bruno Prémont

[permalink] [raw]
Subject: Re: [PATCH 1/3] HID: picolcd: fix misuse of logical operation in place of bitop

Thanks for spotting,

Acked-by: Bruno Prémont <[email protected]>

On Mon, 27 December 2010 David Sterba <[email protected]> wrote:
> CC: Bruno Prémont <[email protected]>
> CC: Jiri Kosina <[email protected]>
> Signed-off-by: David Sterba <[email protected]>
> ---
> drivers/hid/hid-picolcd.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hid/hid-picolcd.c b/drivers/hid/hid-picolcd.c
> index bc2e077..0aff3cd 100644
> --- a/drivers/hid/hid-picolcd.c
> +++ b/drivers/hid/hid-picolcd.c
> @@ -1544,7 +1544,7 @@ static ssize_t picolcd_debug_eeprom_read(struct file *f, char __user *u,
>
> /* prepare buffer with info about what we want to read (addr & len) */
> raw_data[0] = *off & 0xff;
> - raw_data[1] = (*off >> 8) && 0xff;
> + raw_data[1] = (*off >> 8) & 0xff;
> raw_data[2] = s < 20 ? s : 20;
> if (*off + raw_data[2] > 0xff)
> raw_data[2] = 0x100 - *off;
> @@ -1583,7 +1583,7 @@ static ssize_t picolcd_debug_eeprom_write(struct file *f, const char __user *u,
>
> memset(raw_data, 0, sizeof(raw_data));
> raw_data[0] = *off & 0xff;
> - raw_data[1] = (*off >> 8) && 0xff;
> + raw_data[1] = (*off >> 8) & 0xff;
> raw_data[2] = s < 20 ? s : 20;
> if (*off + raw_data[2] > 0xff)
> raw_data[2] = 0x100 - *off;