Re: [PATCH] staging: gdm724x: gdm_tty: replaced macro with a function
From: Joe Perches
Date: Wed Sep 02 2020 - 03:02:00 EST
On Tue, 2020-09-01 at 22:16 +0200, Antoni Przybylik wrote:
> This approach is more elegant and prevents some problems related to
> macros such as operator precedence in expanded expression.
[]
> diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c
[]
> @@ -36,6 +34,11 @@ 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"};
>
> +static int gdm_tty_ready(struct gdm *gdm)
> +{
> + return (gdm && gdm->tty_dev && gdm->port.count);
> +}
static bool gdm_tty_ready might be better.