From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: Daniel Xu <dxu@dxuuu.xyz>,
jolsa@kernel.org, quentin@isovalent.com, eddyz87@gmail.com,
andrii.nakryiko@gmail.com, ast@kernel.org, daniel@iogearbox.net,
bpf@vger.kernel.org
Subject: Re: [PATCH dwarves v6 1/3] gobuffer: Add gobuffer__sort() helper
Date: Wed, 17 Apr 2024 10:40:33 -0300 [thread overview]
Message-ID: <Zh_RUWT4b3QC31k6@x1> (raw)
In-Reply-To: <76869286-5593-470e-b04a-e38f1613c361@oracle.com>
On Wed, Apr 17, 2024 at 10:20:41AM +0100, Alan Maguire wrote:
> On 25/03/2024 17:53, Daniel Xu wrote:
> > Add a helper to sort the gobuffer. Trivial wrapper around qsort().
> >
> > Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
> Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
> > ---
> > gobuffer.c | 5 +++++
> > gobuffer.h | 2 ++
> > 2 files changed, 7 insertions(+)
> >
> > diff --git a/gobuffer.c b/gobuffer.c
> > index 02b2084..4655339 100644
> > --- a/gobuffer.c
> > +++ b/gobuffer.c
> > @@ -102,6 +102,11 @@ void gobuffer__copy(const struct gobuffer *gb, void *dest)
> > }
> > }
> >
> > +void gobuffer__sort(struct gobuffer *gb, unsigned int size, int (*compar)(const void *, const void *))
> > +{
> > + qsort((void *)gb->entries, gb->nr_entries, size, compar);
>
> nit shouldn't need to cast char * gb->entries to void * ; not worth
> respinning the series for though unless there are other issues
I can remove that while applying the series, which I'm doing now.
- Arnaldo
> > +}
> > +
> > const void *gobuffer__compress(struct gobuffer *gb, unsigned int *size)
> > {
> > z_stream z = {
> > diff --git a/gobuffer.h b/gobuffer.h
> > index a12c5c8..cd218b6 100644
> > --- a/gobuffer.h
> > +++ b/gobuffer.h
> > @@ -21,6 +21,8 @@ void __gobuffer__delete(struct gobuffer *gb);
> >
> > void gobuffer__copy(const struct gobuffer *gb, void *dest);
> >
> > +void gobuffer__sort(struct gobuffer *gb, unsigned int size, int (*compar)(const void *, const void *));
> > +
> > int gobuffer__add(struct gobuffer *gb, const void *s, unsigned int len);
> > int gobuffer__allocate(struct gobuffer *gb, unsigned int len);
> >
next prev parent reply other threads:[~2024-04-17 13:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-25 17:53 [PATCH dwarves v6 0/3] pahole: Inject kfunc decl tags into BTF Daniel Xu
2024-03-25 17:53 ` [PATCH dwarves v6 1/3] gobuffer: Add gobuffer__sort() helper Daniel Xu
2024-04-17 9:20 ` Alan Maguire
2024-04-17 13:40 ` Arnaldo Carvalho de Melo [this message]
2024-04-18 9:31 ` Alan Maguire
2024-03-25 17:53 ` [PATCH dwarves v6 2/3] pahole: Add --btf_feature=decl_tag_kfuncs feature Daniel Xu
2024-03-25 17:53 ` [PATCH dwarves v6 3/3] pahole: Inject kfunc decl tags into BTF Daniel Xu
2024-04-17 9:32 ` Alan Maguire
2024-04-02 20:24 ` [PATCH dwarves v6 0/3] " Arnaldo Carvalho de Melo
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=Zh_RUWT4b3QC31k6@x1 \
--to=acme@kernel.org \
--cc=alan.maguire@oracle.com \
--cc=andrii.nakryiko@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=dxu@dxuuu.xyz \
--cc=eddyz87@gmail.com \
--cc=jolsa@kernel.org \
--cc=quentin@isovalent.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.