staging: gdm724x: gdm_tty: replaced macro with a function
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.
--- drivers/staging/gdm724x/gdm_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/gdm724x/gdm_tty.c +1 -1
@@ -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); }
Signature · 1 line
2.28.0
Quoted 2 lines · Antoni Przybylik
Changed return type to bool and removed inline specifier. Also added
static specifier.
why remove the inline specifier?
thanks.
Quoted 19 lines
Signed-off-by Antoni Przybylik <[email protected]>--- drivers/staging/gdm724x/gdm_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/gdm724x/gdm_tty.c +1
-1@@ -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); }
Signature · 1 line
~Randy
Quoted 4 lines · Randy Dunlap
Quoted 2 lines · Antoni Przybylik
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.
Quoted 15 lines
thanks.
Quoted 13 lines
Signed-off-by Antoni Przybylik <[email protected]>--- drivers/staging/gdm724x/gdm_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/gdm724x/gdm_tty.c +0
-0@@ -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" };
Quoted 7 lines
drivers/staging/gdm724x/gdm_tty.c static DEFINE_MUTEX(gdm_table_lock); · line 40
Quoted 6 lines
drivers/staging/gdm724x/gdm_tty.c +1
-1-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
Quoted 12 lines · On 9/2/20 10:07 AM, [email protected] wrote:
Quoted 4 lines · Randy Dunlap
Quoted 2 lines · Antoni Przybylik
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.
Quoted 1 line
thanks.
OK, thanks.
Sometimes the compiler will also ignore inline if it wants to. That's why we have to use __always_inline.
Quoted 21 lines
Quoted 6 lines
Quoted 6 lines
Signed-off-by Antoni Przybylik <[email protected]>---
drivers/staging/gdm724x/gdm_tty.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)Quoted 14 lines
drivers/staging/gdm724x/gdm_tty.c static DEFINE_MUTEX(gdm_table_lock); · line 40
Quoted 13 lines
drivers/staging/gdm724x/gdm_tty.c +1
-0@@ -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
Signature · 2 lines
~Randy Reported-by: Randy Dunlap <[email protected]>
Greg KH
maintainerQuoted 7 lines · Antoni Przybylik
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