2014-12-30 13:28:34

by Alexander Kuleshov

[permalink] [raw]
Subject: [PATCH v2] x86/boot/early_serial_console: Remove unnecessary check

There is already the same check before.

Signed-off-by: Alexander Kuleshov <[email protected]>
---
arch/x86/boot/early_serial_console.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c
index 5df2869..62abcc8 100644
--- a/arch/x86/boot/early_serial_console.c
+++ b/arch/x86/boot/early_serial_console.c
@@ -74,8 +74,7 @@ static void parse_earlyprintk(void)
static const int bases[] = { 0x3f8, 0x2f8 };
int idx = 0;

- if (!strncmp(arg + pos, "ttyS", 4))
- pos += 4;
+ pos += 4;

if (arg[pos++] == '1')
idx = 1;
--
2.2.1.202.g44ae4ee.dirty


2014-12-30 15:48:14

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH v2] x86/boot/early_serial_console: Remove unnecessary check

On Tue, Dec 30, 2014 at 07:28:22PM +0600, Alexander Kuleshov wrote:
> There is already the same check before.
>
> Signed-off-by: Alexander Kuleshov <[email protected]>
> ---
> arch/x86/boot/early_serial_console.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c
> index 5df2869..62abcc8 100644
> --- a/arch/x86/boot/early_serial_console.c
> +++ b/arch/x86/boot/early_serial_console.c
> @@ -74,8 +74,7 @@ static void parse_earlyprintk(void)
> static const int bases[] = { 0x3f8, 0x2f8 };
> int idx = 0;
>
> - if (!strncmp(arg + pos, "ttyS", 4))
> - pos += 4;

You might need a comment to explain the advancing of pos to people who
look at this in the future, i.e. something like

/* += strlen("ttyS"); */
pos += 4;
>
> if (arg[pos++] == '1')
> idx = 1;

--
Regards/Gruss,
Boris.
--

2014-12-30 16:58:31

by Alexander Kuleshov

[permalink] [raw]
Subject: Re: [PATCH v2] x86/boot/early_serial_console: Remove unnecessary check

Do i need to send patch v3 to separate mail thread or add to it?

2014-12-30 21:48 GMT+06:00 Borislav Petkov <[email protected]>:
> On Tue, Dec 30, 2014 at 07:28:22PM +0600, Alexander Kuleshov wrote:
>> There is already the same check before.
>>
>> Signed-off-by: Alexander Kuleshov <[email protected]>
>> ---
>> arch/x86/boot/early_serial_console.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c
>> index 5df2869..62abcc8 100644
>> --- a/arch/x86/boot/early_serial_console.c
>> +++ b/arch/x86/boot/early_serial_console.c
>> @@ -74,8 +74,7 @@ static void parse_earlyprintk(void)
>> static const int bases[] = { 0x3f8, 0x2f8 };
>> int idx = 0;
>>
>> - if (!strncmp(arg + pos, "ttyS", 4))
>> - pos += 4;
>
> You might need a comment to explain the advancing of pos to people who
> look at this in the future, i.e. something like
>
> /* += strlen("ttyS"); */
> pos += 4;
>>
>> if (arg[pos++] == '1')
>> idx = 1;
>
> --
> Regards/Gruss,
> Boris.
> --



--
_________________________
0xAX