Re: [PATCH] scsi: ufs: core: Fix link error when CONFIG_RPMB=m
From: Bean Huo
Date: Wed Dec 03 2025 - 11:23:33 EST
On Wed, 2025-12-03 at 15:39 +0100, Arnd Bergmann wrote:
> On Wed, Dec 3, 2025, at 07:15, kernel test robot wrote:
> >
> > All errors (new ones prefixed by >>):
> >
> > > > drivers/ufs/core/ufs-rpmb.c:135:5: error: redefinition of
> > > > 'ufs_rpmb_probe'
> > 135 | int ufs_rpmb_probe(struct ufs_hba *hba)
> > | ^
> > drivers/ufs/core/ufshcd-priv.h:445:19: note: previous definition is here
> > 445 | static inline int ufs_rpmb_probe(struct ufs_hba *hba)
> > | ^
> > > > drivers/ufs/core/ufs-rpmb.c:234:6: error: redefinition of
> > > > 'ufs_rpmb_remove'
>
> The declaration and definitio are inconsistent: the former is inside of
> an #ifdef block, the latter is not. I think either way works, but it
> needs to be the same for both.
>
> Arnd
Hi Arnd,
I was reviewing the kernel test robot output regarding the ufs_rpmb_probe and
ufs_rpmb_remove redefinition errors, and I wanted to clarify my understanding
>From what I see in the source:
#if IS_ENABLED(CONFIG_RPMB)
int ufs_rpmb_probe(struct ufs_hba *hba);
void ufs_rpmb_remove(struct ufs_hba *hba);
#else
static inline int ufs_rpmb_probe(struct ufs_hba *hba) { return 0; }
static inline void ufs_rpmb_remove(struct ufs_hba *hba) { }
#endif
my understanding is that if CONFIG_RPMB=n, compilation goes into the #else
branch, which emits static inline stubs, so ufs-rpmb.c should not be compiled at
all because of ufshcd-core-$(CONFIG_RPMB) += ufs-rpmb.o in the Makefile.
However, the robot reported redefinition errors, which suggests that the
header’s #else branch is being included while ufs-rpmb.c is also being compiled.
I’m wondering if I’m missing something about the robot’s build logic.
Thanks,
Bean