From: Bastien Nocera <hadess@hadess.net>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ 1/2] shared/util: Add MIN/MAX implementations
Date: Tue, 31 Mar 2026 23:37:44 +0200 [thread overview]
Message-ID: <e6ce48e9a2d2b67ed069e91e7cc71f0ca8249a97.camel@hadess.net> (raw)
In-Reply-To: <CABBYNZ+mm1q0gKCajcv4AnuNn13j5DXKzWAmDvCRj1LuGTfRag@mail.gmail.com>
On Tue, 2026-03-31 at 10:00 -0400, Luiz Augusto von Dentz wrote:
> Hi Bastien,
>
> On Mon, Mar 30, 2026 at 10:42 AM Bastien Nocera <hadess@hadess.net>
> wrote:
> >
> > And remove it from src/sdpd-request.c to avoid a redefinition
> > warning
> > at compile-time.
> > ---
> > src/sdpd-request.c | 2 --
> > src/shared/util.h | 6 ++++++
> > 2 files changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/sdpd-request.c b/src/sdpd-request.c
> > index 1fc07e97bfe0..7c632c2aaf62 100644
> > --- a/src/sdpd-request.c
> > +++ b/src/sdpd-request.c
> > @@ -40,8 +40,6 @@ typedef struct {
> >
> > #define SDP_CONT_STATE_SIZE (sizeof(uint8_t) +
> > sizeof(sdp_cont_state_t))
> >
> > -#define MIN(x, y) ((x) < (y)) ? (x): (y)
> > -
> > typedef struct sdp_cont_info sdp_cont_info_t;
> >
> > struct sdp_cont_info {
> > diff --git a/src/shared/util.h b/src/shared/util.h
> > index c480351d6e9f..99a5aa2daf32 100644
> > --- a/src/shared/util.h
> > +++ b/src/shared/util.h
> > @@ -22,6 +22,12 @@
> > #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
> > #define BIT(n) (1 << (n))
> >
> > +#undef MIN
> > +#define MIN(a, b) ((a) > (b) ? (a) : (b))
> > +
> > +#undef MAX
> > +#define MAX(a, b) ((a) < (b) ? (a) : (b))
>
> This is causing many tests to fail with `make check`. It looks like
> the conditions are wrong, so MIN works as MAX and vice versa.
Whoops, fixed.
>
> > #if __BYTE_ORDER == __LITTLE_ENDIAN
> > #define le16_to_cpu(val) (val)
> > #define le32_to_cpu(val) (val)
> > --
> > 2.53.0
> >
> >
>
prev parent reply other threads:[~2026-03-31 21:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 14:30 [PATCH BlueZ 1/2] shared/util: Add MIN/MAX implementations Bastien Nocera
2026-03-30 14:30 ` [PATCH BlueZ 2/2] emulator: Remove compile-time header only glib dep Bastien Nocera
2026-03-31 14:00 ` [PATCH BlueZ 1/2] shared/util: Add MIN/MAX implementations Luiz Augusto von Dentz
2026-03-31 21:37 ` Bastien Nocera [this message]
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=e6ce48e9a2d2b67ed069e91e7cc71f0ca8249a97.camel@hadess.net \
--to=hadess@hadess.net \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox