Re: [PATCH bpf] samples/bpf: use canonical fallthrough pseudo-keyword in hbm.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 15, 2023 at 5:02 PM Yonghong Song <yhs@xxxxxxxx> wrote:
>
>
>
> On 5/15/23 1:02 PM, Andrii Nakryiko wrote:
> > Rename now unsupported __fallthrough into fallthrough ([0]) in
> > samples/bpf/hbm.c to fix samples/bpf compilation.
> >
> >    [0] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
> >
> > Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx>
>
> LGTM. But there is an alternative, see below.
>
> Acked-by: Yonghong Song <yhs@xxxxxx>
>
> > ---
> >   samples/bpf/hbm.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/samples/bpf/hbm.c b/samples/bpf/hbm.c
> > index 6448b7826107..7ddf25e9d098 100644
> > --- a/samples/bpf/hbm.c
> > +++ b/samples/bpf/hbm.c
> > @@ -498,7 +498,7 @@ int main(int argc, char **argv)
> >                                       "Option -%c requires an argument.\n\n",
> >                                       optopt);
> >               case 'h':
> > -                     __fallthrough;
> > +                     fallthrough;
>
> We could remove this 'fallthrough' completely since there is
> no code under case 'h'.


yep, should have done it from the get go, will send v2

>
> >               default:
> >                       Usage();
> >                       return 0;





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux