On Wed, Jan 29, 2025 at 11:32 AM Eric Herman <[email protected]> wrote:
> Hello Andreas,
>
> On 2025-01-28 17:38, Andreas Gruenbacher wrote:
> > This statement does nothing.
>
> I would suggest this statement does nothing only in the case of #ifndef
> CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS.
>
> In the case where CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS _is_ defined,
> it tells the compiler that it should not emit a warning for an unused
> parameter.
>
> Perhaps it should be moved in to an #else of the #ifndef in order to
> more clearly communicate that it is expected and okay to ignore this
> parameter in this case.

How about declaring base __maybe_unused?

Thanks,
Andreas

> Cheers,
> -Eric
>
> >
> > Signed-off-by: Andreas Gruenbacher <[email protected]>
> > ---
> >   fs/bcachefs/eytzinger.c | 1 -
> >   1 file changed, 1 deletion(-)
> >
> > diff --git a/fs/bcachefs/eytzinger.c b/fs/bcachefs/eytzinger.c
> > index 2eaffe37b5e7..c0fdfe909cf2 100644
> > --- a/fs/bcachefs/eytzinger.c
> > +++ b/fs/bcachefs/eytzinger.c
> > @@ -20,7 +20,6 @@ static bool is_aligned(const void *base, size_t size, 
> > unsigned char align)
> >   {
> >       unsigned char lsbits = (unsigned char)size;
> >
> > -     (void)base;
> >   #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
> >       lsbits |= (unsigned char)(uintptr_t)base;
> >   #endif
>


Reply via email to