2012-11-29 04:58:10

by YAMANE Toshiaki

[permalink] [raw]
Subject: [PATCH] staging/serqt_usb2: Refactor qt_status_change_check() in serqt_usb2.c

Improved position to increment variable i,
And typo fixes.

Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/serqt_usb2/serqt_usb2.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c
index 1b3e995..095d6f2 100644
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -309,26 +309,26 @@ static void qt_status_change_check(struct tty_struct *tty,
case 0x00:
if (i > (RxCount - 4)) {
dev_dbg(&port->dev,
- "Illegal escape seuences in received data\n");
+ "Illegal escape sequence in received data\n");
break;
}

- ProcessLineStatus(qt_port, data[i + 3]);
-
i += 3;
+ ProcessLineStatus(qt_port, data[i]);
+
flag = 1;
break;

case 0x01:
if (i > (RxCount - 4)) {
dev_dbg(&port->dev,
- "Illegal escape seuences in received data\n");
+ "Illegal escape sequence in received data\n");
break;
}

- ProcessModemStatus(qt_port, data[i + 3]);
-
i += 3;
+ ProcessModemStatus(qt_port, data[i]);
+
flag = 1;
break;

--
1.7.9.5


2012-11-30 02:10:32

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] staging/serqt_usb2: Refactor qt_status_change_check() in serqt_usb2.c

On Thu, Nov 29, 2012 at 01:57:56PM +0900, YAMANE Toshiaki wrote:
> Improved position to increment variable i,
> And typo fixes.
>
> Signed-off-by: YAMANE Toshiaki <[email protected]>
> ---
> drivers/staging/serqt_usb2/serqt_usb2.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c
> index 1b3e995..095d6f2 100644
> --- a/drivers/staging/serqt_usb2/serqt_usb2.c
> +++ b/drivers/staging/serqt_usb2/serqt_usb2.c
> @@ -309,26 +309,26 @@ static void qt_status_change_check(struct tty_struct *tty,
> case 0x00:
> if (i > (RxCount - 4)) {
> dev_dbg(&port->dev,
> - "Illegal escape seuences in received data\n");
> + "Illegal escape sequence in received data\n");

This is a different type of fix from:

> break;
> }
>
> - ProcessLineStatus(qt_port, data[i + 3]);
> -
> i += 3;
> + ProcessLineStatus(qt_port, data[i]);

I think you just changed the logic in this function, didn't you?

> +
> flag = 1;
> break;
>
> case 0x01:
> if (i > (RxCount - 4)) {
> dev_dbg(&port->dev,
> - "Illegal escape seuences in received data\n");
> + "Illegal escape sequence in received data\n");
> break;
> }
>
> - ProcessModemStatus(qt_port, data[i + 3]);
> -
> i += 3;
> + ProcessModemStatus(qt_port, data[i]);

Same here, what happens to i after this?

Please break into two patches, and verify that you didn't break anything
here.

thanks,

greg k-h

2012-11-30 05:25:20

by YAMANE Toshiaki

[permalink] [raw]
Subject: Re: [PATCH] staging/serqt_usb2: Refactor qt_status_change_check() in serqt_usb2.c

On Fri, Nov 30, 2012 at 11:10 AM, Greg Kroah-Hartman
<[email protected]> wrote:
> On Thu, Nov 29, 2012 at 01:57:56PM +0900, YAMANE Toshiaki wrote:
>> Improved position to increment variable i,
>> And typo fixes.
>>
>> Signed-off-by: YAMANE Toshiaki <[email protected]>
>> ---
>> drivers/staging/serqt_usb2/serqt_usb2.c | 12 ++++++------
>> 1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c
>> index 1b3e995..095d6f2 100644
>> --- a/drivers/staging/serqt_usb2/serqt_usb2.c
>> +++ b/drivers/staging/serqt_usb2/serqt_usb2.c
>> @@ -309,26 +309,26 @@ static void qt_status_change_check(struct tty_struct *tty,
>> case 0x00:
>> if (i > (RxCount - 4)) {
>> dev_dbg(&port->dev,
>> - "Illegal escape seuences in received data\n");
>> + "Illegal escape sequence in received data\n");
>
> This is a different type of fix from:
>
>> break;
>> }
>>
>> - ProcessLineStatus(qt_port, data[i + 3]);
>> -
>> i += 3;
>> + ProcessLineStatus(qt_port, data[i]);
>
> I think you just changed the logic in this function, didn't you?
>
>> +
>> flag = 1;
>> break;
>>
>> case 0x01:
>> if (i > (RxCount - 4)) {
>> dev_dbg(&port->dev,
>> - "Illegal escape seuences in received data\n");
>> + "Illegal escape sequence in received data\n");
>> break;
>> }
>>
>> - ProcessModemStatus(qt_port, data[i + 3]);
>> -
>> i += 3;
>> + ProcessModemStatus(qt_port, data[i]);
>
> Same here, what happens to i after this?
>
> Please break into two patches, and verify that you didn't break anything
> here.

Greg-san,

I am sorry for confusion.
I sent the patch twice since following patch was applied (gregkh/staging-next)

commit 9d36976fad3008fcc4209789566f7f3e7763f212
Modify qt_status_change_check() and delete qt_status_change().

-Incorporate comment of Mr.Joe Perches (sent Nov.17)
-I sent yesterday

Please discard the patches.

Thanks,


YAMANE Toshiaki

2012-11-30 08:25:41

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH] staging/serqt_usb2: Refactor qt_status_change_check() in serqt_usb2.c

On Thu, Nov 29, 2012 at 06:10:26PM -0800, Greg Kroah-Hartman wrote:
> On Thu, Nov 29, 2012 at 01:57:56PM +0900, YAMANE Toshiaki wrote:
> >
> > - ProcessLineStatus(qt_port, data[i + 3]);
> > -
> > i += 3;
> > + ProcessLineStatus(qt_port, data[i]);
>
> I think you just changed the logic in this function, didn't you?

This should be ok. The i += 3 was there in the original, it's just
moved up a line.

regards,
dan carpenter

2012-11-30 12:53:59

by YAMANE Toshiaki

[permalink] [raw]
Subject: Re: [PATCH] staging/serqt_usb2: Refactor qt_status_change_check() in serqt_usb2.c

On Fri, Nov 30, 2012 at 5:25 PM, Dan Carpenter <[email protected]> wrote:
> On Thu, Nov 29, 2012 at 06:10:26PM -0800, Greg Kroah-Hartman wrote:
>> On Thu, Nov 29, 2012 at 01:57:56PM +0900, YAMANE Toshiaki wrote:
>> >
>> > - ProcessLineStatus(qt_port, data[i + 3]);
>> > -
>> > i += 3;
>> > + ProcessLineStatus(qt_port, data[i]);
>>
>> I think you just changed the logic in this function, didn't you?
>
> This should be ok. The i += 3 was there in the original, it's just
> moved up a line.

Thanks for your kindness reply.

But please discard this patch.
Let me consider this patch again.


Regards,

YAMANE Toshiaki