2020-09-02 16:18:59

by Antoni Przybylik

[permalink] [raw]
Subject: [PATCH v2 2/2] staging: gdm724x: gdm_tty: replaced macro with a function

Changed return type to bool and removed inline specifier. Also added
static specifier.

Signed-off-by: Antoni Przybylik <[email protected]>
---
drivers/staging/gdm724x/gdm_tty.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c
index 34a13d98c029..179fc9b9400b 100644
--- a/drivers/staging/gdm724x/gdm_tty.c
+++ b/drivers/staging/gdm724x/gdm_tty.c
@@ -34,7 +34,7 @@ static DEFINE_MUTEX(gdm_table_lock);
static const char *DRIVER_STRING[TTY_MAX_COUNT] = {"GCTATC", "GCTDM"};
static char *DEVICE_STRING[TTY_MAX_COUNT] = {"GCT-ATC", "GCT-DM"};

-inline int gdm_tty_ready(struct gdm *gdm)
+static bool gdm_tty_ready(struct gdm *gdm)
{
return (gdm && gdm->tty_dev && gdm->port.count);
}
--
2.28.0


2020-09-02 16:22:32

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] staging: gdm724x: gdm_tty: replaced macro with a function

On 9/2/20 9:16 AM, Antoni Przybylik wrote:
> Changed return type to bool and removed inline specifier. Also added
> static specifier.

why remove the inline specifier?
thanks.

> Signed-off-by: Antoni Przybylik <[email protected]>
> ---
> drivers/staging/gdm724x/gdm_tty.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c
> index 34a13d98c029..179fc9b9400b 100644
> --- a/drivers/staging/gdm724x/gdm_tty.c
> +++ b/drivers/staging/gdm724x/gdm_tty.c
> @@ -34,7 +34,7 @@ static DEFINE_MUTEX(gdm_table_lock);
> static const char *DRIVER_STRING[TTY_MAX_COUNT] = {"GCTATC", "GCTDM"};
> static char *DEVICE_STRING[TTY_MAX_COUNT] = {"GCT-ATC", "GCT-DM"};
>
> -inline int gdm_tty_ready(struct gdm *gdm)
> +static bool gdm_tty_ready(struct gdm *gdm)
> {
> return (gdm && gdm->tty_dev && gdm->port.count);
> }
>


--
~Randy

2020-09-02 17:08:19

by Antoni Przybylik

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] staging: gdm724x: gdm_tty: replaced macro with a function

On 02.09.2020 18:21, Randy Dunlap wrote:
> On 9/2/20 9:16 AM, Antoni Przybylik wrote:
>> Changed return type to bool and removed inline specifier. Also added
>> static specifier.
> why remove the inline specifier?

Greg KH wrote to me:

And really, no need to make it inline, just make it a normal function
and the compiler will inline it if needed.

> thanks.
>
>> Signed-off-by: Antoni Przybylik <[email protected]>
>> ---
>> drivers/staging/gdm724x/gdm_tty.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c
>> index 34a13d98c029..179fc9b9400b 100644
>> --- a/drivers/staging/gdm724x/gdm_tty.c
>> +++ b/drivers/staging/gdm724x/gdm_tty.c
>> @@ -34,7 +34,7 @@ static DEFINE_MUTEX(gdm_table_lock);
>> static const char *DRIVER_STRING[TTY_MAX_COUNT] = {"GCTATC", "GCTDM"};
>> static char *DEVICE_STRING[TTY_MAX_COUNT] = {"GCT-ATC", "GCT-DM"};
>>
>> -inline int gdm_tty_ready(struct gdm *gdm)
>> +static bool gdm_tty_ready(struct gdm *gdm)
>> {
>> return (gdm && gdm->tty_dev && gdm->port.count);
>> }
>>
>
Antoni Przybylik

2020-09-02 17:18:46

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] staging: gdm724x: gdm_tty: replaced macro with a function

On 9/2/20 10:07 AM, [email protected] wrote:
> On 02.09.2020 18:21, Randy Dunlap wrote:
>> On 9/2/20 9:16 AM, Antoni Przybylik wrote:
>>> Changed return type to bool and removed inline specifier. Also added
>>>   static specifier.
>> why remove the inline specifier?
>
> Greg KH wrote to me:
>
> And really, no need to make it inline, just make it a normal function
> and the compiler will inline it if needed.
>
>> thanks.

OK, thanks.
Sometimes the compiler will also ignore inline if it wants to.
That's why we have to use __always_inline.

>>
>>> Signed-off-by: Antoni Przybylik <[email protected]>
>>> ---
>>>   drivers/staging/gdm724x/gdm_tty.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c
>>> index 34a13d98c029..179fc9b9400b 100644
>>> --- a/drivers/staging/gdm724x/gdm_tty.c
>>> +++ b/drivers/staging/gdm724x/gdm_tty.c
>>> @@ -34,7 +34,7 @@ static DEFINE_MUTEX(gdm_table_lock);
>>>   static const char *DRIVER_STRING[TTY_MAX_COUNT] = {"GCTATC", "GCTDM"};
>>>   static char *DEVICE_STRING[TTY_MAX_COUNT] = {"GCT-ATC", "GCT-DM"};
>>>   -inline int gdm_tty_ready(struct gdm *gdm)
>>> +static bool gdm_tty_ready(struct gdm *gdm)
>>>   {
>>>       return (gdm && gdm->tty_dev && gdm->port.count);
>>>   }
>>>
>>
> Antoni Przybylik


--
~Randy
Reported-by: Randy Dunlap <[email protected]>

2020-09-04 13:50:19

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] staging: gdm724x: gdm_tty: replaced macro with a function

On Wed, Sep 02, 2020 at 06:16:27PM +0200, Antoni Przybylik wrote:
> Changed return type to bool and removed inline specifier. Also added
> static specifier.
>
> Signed-off-by: Antoni Przybylik <[email protected]>
> ---
> drivers/staging/gdm724x/gdm_tty.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

You sent 2 patches with the identical subject line, yet they did
different things :(

Please fix them both up and resend.

thanks,

greg k-h