Re: [PATCH 01/21] bcachefs: remove dead code in is_aligned

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Andreas,

On 2025-01-29 14:19, Andreas Gruenbacher wrote:
On Wed, Jan 29, 2025 at 11:32 AM Eric Herman <eric@xxxxxxxxxxxxxxxxxxxxx> 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?

Yes, that would be better.

Cheers,

-Eric



Thanks,
Andreas

Cheers,
-Eric

Signed-off-by: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
---
   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




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux