All of lore.kernel.org
 help / color / mirror / Atom feed
From: Song Liu <liu.song.a23@gmail.com>
To: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: YueHaibing <yuehaibing@huawei.com>,
	"David S . Miller" <davem@davemloft.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	John Fastabend <john.fastabend@gmail.com>,
	open list <linux-kernel@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>,
	xdp-newbies@vger.kernel.org, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH net-next] xdp: Make __mem_id_disconnect static
Date: Tue, 25 Jun 2019 15:23:24 -0700	[thread overview]
Message-ID: <CAPhsuW7e8KLooD_ASwWE_dbJwNTcs5sqR66LTWxR-cH3SBzSJw@mail.gmail.com> (raw)
In-Reply-To: <20190625112104.6654a048@carbon>

On Tue, Jun 25, 2019 at 4:52 AM Jesper Dangaard Brouer
<brouer@redhat.com> wrote:
>
> On Tue, 25 Jun 2019 10:31:37 +0800
> YueHaibing <yuehaibing@huawei.com> wrote:
>
> > Fix sparse warning:
> >
> > net/core/xdp.c:88:6: warning:
> >  symbol '__mem_id_disconnect' was not declared. Should it be static?
>
> I didn't declare it static as I didn't want it to get inlined.  As
> during development I was using kprobes to inspect this function.  In
> the end I added a tracepoint in this function as kprobes was not enough
> to capture the state needed.
>
> So, I guess we can declare it static.
>
> Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>

I think the rule is, non-static function must be declared in a header.

Acked-by: Song Liu <songliubraving@fb.com>

>
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> > ---
> >  net/core/xdp.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/core/xdp.c b/net/core/xdp.c
> > index b29d7b5..829377c 100644
> > --- a/net/core/xdp.c
> > +++ b/net/core/xdp.c
> > @@ -85,7 +85,7 @@ static void __xdp_mem_allocator_rcu_free(struct rcu_head *rcu)
> >       kfree(xa);
> >  }
> >
> > -bool __mem_id_disconnect(int id, bool force)
> > +static bool __mem_id_disconnect(int id, bool force)
> >  {
> >       struct xdp_mem_allocator *xa;
> >       bool safe_to_remove = true;
>
>
> --
> Best regards,
>   Jesper Dangaard Brouer
>   MSc.CS, Principal Kernel Engineer at Red Hat
>   LinkedIn: http://www.linkedin.com/in/brouer

  reply	other threads:[~2019-06-25 22:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25  2:31 [PATCH net-next] xdp: Make __mem_id_disconnect static YueHaibing
2019-06-25  2:31 ` YueHaibing
2019-06-25  9:21 ` Jesper Dangaard Brouer
2019-06-25  9:21   ` Jesper Dangaard Brouer
2019-06-25 22:23   ` Song Liu [this message]
2019-06-26 14:33 ` Daniel Borkmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPhsuW7e8KLooD_ASwWE_dbJwNTcs5sqR66LTWxR-cH3SBzSJw@mail.gmail.com \
    --to=liu.song.a23@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=john.fastabend@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=xdp-newbies@vger.kernel.org \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.