2022-04-30 22:51:04

by Athira Rajeev

[permalink] [raw]
Subject: Re: [PATCH 1/2] perf bench: Fix two numa NDEBUG warnings



> On 29-Apr-2022, at 1:59 AM, Ian Rogers <[email protected]> wrote:
>
> BUG_ON is a no-op if NDEBUG is defined, otherwise it is an assert.
> Compiling with NDEBUG yields:
>
> bench/numa.c: In function ‘bind_to_cpu’:
> bench/numa.c:314:1: error: control reaches end of non-void function [-Werror=return-type]
> 314 | }
> | ^
> bench/numa.c: In function ‘bind_to_node’:
> bench/numa.c:367:1: error: control reaches end of non-void function [-Werror=return-type]
> 367 | }
> | ^
>
> Add return statements to cover this case.

Looks fine to me

Reviewed-by: Athira Rajeev <[email protected]>

Thanks
Athira
>
> Signed-off-by: Ian Rogers <[email protected]>
> ---
> tools/perf/bench/numa.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c
> index 44e1f8a44087..d5289fa58a4f 100644
> --- a/tools/perf/bench/numa.c
> +++ b/tools/perf/bench/numa.c
> @@ -311,6 +311,7 @@ static cpu_set_t *bind_to_cpu(int target_cpu)
>
> /* BUG_ON due to failure in allocation of orig_mask/mask */
> BUG_ON(-1);
> + return NULL;
> }
>
> static cpu_set_t *bind_to_node(int target_node)
> @@ -364,6 +365,7 @@ static cpu_set_t *bind_to_node(int target_node)
>
> /* BUG_ON due to failure in allocation of orig_mask/mask */
> BUG_ON(-1);
> + return NULL;
> }
>
> static void bind_to_cpumask(cpu_set_t *mask)
> --
> 2.36.0.464.gb9c8b46e94-goog
>


2022-05-01 04:20:16

by Ian Rogers

[permalink] [raw]
Subject: Re: [PATCH 1/2] perf bench: Fix two numa NDEBUG warnings

On Fri, Apr 29, 2022 at 2:21 AM Athira Rajeev
<[email protected]> wrote:
>
>
>
> > On 29-Apr-2022, at 1:59 AM, Ian Rogers <[email protected]> wrote:
> >
> > BUG_ON is a no-op if NDEBUG is defined, otherwise it is an assert.
> > Compiling with NDEBUG yields:
> >
> > bench/numa.c: In function ‘bind_to_cpu’:
> > bench/numa.c:314:1: error: control reaches end of non-void function [-Werror=return-type]
> > 314 | }
> > | ^
> > bench/numa.c: In function ‘bind_to_node’:
> > bench/numa.c:367:1: error: control reaches end of non-void function [-Werror=return-type]
> > 367 | }
> > | ^
> >
> > Add return statements to cover this case.
>
> Looks fine to me
>
> Reviewed-by: Athira Rajeev <[email protected]>
>
> Thanks
> Athira

Thanks Athira :-) Arnaldo, could we get this in the 5th batch for 5.18
to keep NDEBUG building? It looks like there is a missing build test
for NDEBUG too.

Thanks,
Ian

> >
> > Signed-off-by: Ian Rogers <[email protected]>
> > ---
> > tools/perf/bench/numa.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c
> > index 44e1f8a44087..d5289fa58a4f 100644
> > --- a/tools/perf/bench/numa.c
> > +++ b/tools/perf/bench/numa.c
> > @@ -311,6 +311,7 @@ static cpu_set_t *bind_to_cpu(int target_cpu)
> >
> > /* BUG_ON due to failure in allocation of orig_mask/mask */
> > BUG_ON(-1);
> > + return NULL;
> > }
> >
> > static cpu_set_t *bind_to_node(int target_node)
> > @@ -364,6 +365,7 @@ static cpu_set_t *bind_to_node(int target_node)
> >
> > /* BUG_ON due to failure in allocation of orig_mask/mask */
> > BUG_ON(-1);
> > + return NULL;
> > }
> >
> > static void bind_to_cpumask(cpu_set_t *mask)
> > --
> > 2.36.0.464.gb9c8b46e94-goog
> >
>

2022-05-03 00:20:47

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH 1/2] perf bench: Fix two numa NDEBUG warnings

Em Fri, Apr 29, 2022 at 06:58:22PM -0700, Ian Rogers escreveu:
> On Fri, Apr 29, 2022 at 2:21 AM Athira Rajeev
> <[email protected]> wrote:
> >
> >
> >
> > > On 29-Apr-2022, at 1:59 AM, Ian Rogers <[email protected]> wrote:
> > >
> > > BUG_ON is a no-op if NDEBUG is defined, otherwise it is an assert.
> > > Compiling with NDEBUG yields:
> > >
> > > bench/numa.c: In function ‘bind_to_cpu’:
> > > bench/numa.c:314:1: error: control reaches end of non-void function [-Werror=return-type]
> > > 314 | }
> > > | ^
> > > bench/numa.c: In function ‘bind_to_node’:
> > > bench/numa.c:367:1: error: control reaches end of non-void function [-Werror=return-type]
> > > 367 | }
> > > | ^
> > >
> > > Add return statements to cover this case.
> >
> > Looks fine to me
> >
> > Reviewed-by: Athira Rajeev <[email protected]>
> >
> > Thanks
> > Athira
>
> Thanks Athira :-) Arnaldo, could we get this in the 5th batch for 5.18
> to keep NDEBUG building? It looks like there is a missing build test
> for NDEBUG too.

Applied to perf/urgent.

Thanks,

- Arnaldo