Re: [PATCH] kernel/sched/core.c: Avoid unused variable on non-SMP configs
From: Vincent Guittot
Date: Mon Sep 10 2018 - 03:00:46 EST
On Sun, 9 Sep 2018 at 19:00, Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> On Sun, Sep 9, 2018 at 6:45 PM, Borislav Petkov <bp@xxxxxxxxx> wrote:
> > On Sun, Sep 09, 2018 at 06:36:01PM +0200, Miguel Ojeda wrote:
> >> No, you get a different warning depending on whether you have enabled
> >> CONFIG_PARAVIRT_TIME_ACCOUNTING or CONFIG_IRQ_TIME_ACCOUNTING.
> >
> > Ok.
> >
> > Still, adding __maybe_unused to both (or writing it before the name,
> > whatever works!) and dropping the ifdeffery is still better for
> > readability's sake than having more ifdeffery, IMO.
>
> Agreed, it is quite confusing already. I tried to keep the style of
> the code, but Ingo/Peter might prefer the cleanup. Let's see...
FYI, another patch has already been sent for this warning
https://lkml.org/lkml/2018/8/10/22
>
> Cheers,
> Miguel