2021-07-15 16:48:49

by Andy Shevchenko

[permalink] [raw]
Subject: [PATCH v2 1/1] auxdisplay: charlcd: Drop unneeded initializers and switch to C99 style

For structure initializers the fields are 0 (or NULL) by default, so
there is no need to fill them explicitly. Besides that, much easier
to read when initializers use C99 style. Hence, convert to C99 style
as well.

Signed-off-by: Andy Shevchenko <[email protected]>
---
v2: completely rewrote patch (Willy)
drivers/auxdisplay/charlcd.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c
index 24fd6f369ebe..304accde365c 100644
--- a/drivers/auxdisplay/charlcd.c
+++ b/drivers/auxdisplay/charlcd.c
@@ -637,9 +637,7 @@ static int panel_notify_sys(struct notifier_block *this, unsigned long code,
}

static struct notifier_block panel_notifier = {
- panel_notify_sys,
- NULL,
- 0
+ .notifier_call = panel_notify_sys,
};

int charlcd_register(struct charlcd *lcd)
--
2.30.2


2021-07-15 23:37:47

by Miguel Ojeda

[permalink] [raw]
Subject: Re: [PATCH v2 1/1] auxdisplay: charlcd: Drop unneeded initializers and switch to C99 style

On Thu, Jul 15, 2021 at 4:41 PM Andy Shevchenko
<[email protected]> wrote:
>
> For structure initializers the fields are 0 (or NULL) by default, so
> there is no need to fill them explicitly. Besides that, much easier
> to read when initializers use C99 style. Hence, convert to C99 style
> as well.
>
> Signed-off-by: Andy Shevchenko <[email protected]>

Queued, thanks!

Cheers,
Miguel