From: Che-liang Chiou <clchiou@chromium.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] Input: serio_raw - cosmetic fixes
Date: Tue, 10 Jan 2012 16:24:37 +0800 [thread overview]
Message-ID: <CANJuy2KrSaqW2XTm4R1+y+KSRZtaNd1_mXW4pP3sOn-_B+h0sw@mail.gmail.com> (raw)
In-Reply-To: <20120109082412.GC4049@core.coreip.homeip.net>
On Mon, Jan 9, 2012 at 4:24 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> Hi Che-Liang,
>
> On Fri, Jan 06, 2012 at 07:03:14PM +0800, Che-Liang Chiou wrote:
>> Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
>> ---
>> drivers/input/serio/serio_raw.c | 4 +---
>> 1 files changed, 1 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
>> index 4d4cd14..a935c38 100644
>> --- a/drivers/input/serio/serio_raw.c
>> +++ b/drivers/input/serio/serio_raw.c
>> @@ -220,7 +220,7 @@ static ssize_t serio_raw_write(struct file *file, const char __user *buffer,
>> goto out;
>> }
>> written++;
>> - };
>> + }
>>
>
> I applied this chunk, thanks.
>
>> out:
>> mutex_unlock(&serio_raw_mutex);
>> @@ -231,11 +231,9 @@ static unsigned int serio_raw_poll(struct file *file, poll_table *wait)
>> {
>> struct serio_raw_client *client = file->private_data;
>> struct serio_raw *serio_raw = client->serio_raw;
>> - unsigned int mask;
>>
>> poll_wait(file, &serio_raw->wait, wait);
>>
>> - mask = serio_raw->dead ? POLLHUP | POLLERR : POLLOUT | POLLWRNORM;
>> if (serio_raw->head != serio_raw->tail)
>> return POLLIN | POLLRDNORM;
>>
>
> This however is not quite correct. I will be applying the patch below
> instead.
Yeah I was wondering maybe you are going to make use of mask
somewhere. But still the patch below is quite strange. To my
understanding the mask is still not used; It is a local variable that
not does not make any side effect. Do you intend to use that mask on
any global state or return value?
> Thanks.
>
> --
> Dmitry
>
> Input: serio-raw - really signal HUP upon disconnect
>
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>
> Commit 8c1c10d5706bbb3b41cb4a5578339d67d3eeffc2 attempted to signal
> POLLHUP | POLLERR condition when polling disconnected device,
> unfortunately it did not do it quite correctly.
>
> Reported-by: Che-Liang Chiou <clchiou@chromium.org>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
> ---
>
> drivers/input/serio/serio_raw.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>
> diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
> index ca78a89..c2c6ad8 100644
> --- a/drivers/input/serio/serio_raw.c
> +++ b/drivers/input/serio/serio_raw.c
> @@ -237,7 +237,7 @@ static unsigned int serio_raw_poll(struct file *file, poll_table *wait)
>
> mask = serio_raw->dead ? POLLHUP | POLLERR : POLLOUT | POLLWRNORM;
> if (serio_raw->head != serio_raw->tail)
> - return POLLIN | POLLRDNORM;
> + mask |= POLLIN | POLLRDNORM;
It seems that mask is a local variable that seems have no effect to
any global state?
> return 0;
> }
next prev parent reply other threads:[~2012-01-10 8:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-06 11:03 [PATCH 1/2] Input: serio_raw - cosmetic fixes Che-Liang Chiou
2012-01-06 11:03 ` [PATCH 2/2] Input: serio_raw - return error code instead of written on error Che-Liang Chiou
2012-01-09 8:27 ` Dmitry Torokhov
2012-01-10 8:27 ` Che-liang Chiou
2012-01-09 8:24 ` [PATCH 1/2] Input: serio_raw - cosmetic fixes Dmitry Torokhov
2012-01-10 8:24 ` Che-liang Chiou [this message]
2012-01-10 8:39 ` Dmitry Torokhov
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=CANJuy2KrSaqW2XTm4R1+y+KSRZtaNd1_mXW4pP3sOn-_B+h0sw@mail.gmail.com \
--to=clchiou@chromium.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).