lkml.org 
[lkml]   [2020]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 11/20] bpf: factor out a bpf_trace_copy_string helper
On Tue, May 19, 2020 at 09:07:55AM -0700, Linus Torvalds wrote:
> On Tue, May 19, 2020 at 6:45 AM Christoph Hellwig <hch@lst.de> wrote:
> >
> > + switch (fmt_ptype) {
> > + case 's':
> > +#ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
> > + strncpy_from_unsafe(buf, unsafe_ptr, bufsz);
> > + break;
> > +#endif
> > + case 'k':
> > + strncpy_from_kernel_nofault(buf, unsafe_ptr, bufsz);
> > + break;
>
> That 's' case needs a "fallthrough;" for the overlapping case,
> methinks. Otherwise you'll get warnings.

I don't think we need it as the case of

case 'a':
case 'b':
do_stuff();
break;

has always been fine even with the fallthough warnings. And the
rest of the stuff gets removed by cpp..

\
 
 \ /
  Last update: 2020-05-19 18:16    [W:0.048 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site