2021-01-04 23:05:10

by Jiri Olsa

[permalink] [raw]
Subject: [PATCH] crypto: Rename struct device_private to bcm_device_private

Renaming 'struct device_private' to 'struct bcm_device_private',
because it clashes with 'struct device_private' from
'drivers/base/base.h'.

While it's not a functional problem, it's causing two distinct
type hierarchies in BTF data. It also breaks build with options:
CONFIG_DEBUG_INFO_BTF=y
CONFIG_CRYPTO_DEV_BCM_SPU=y

as reported by Qais Yousef [1].

[1] https://lore.kernel.org/lkml/20201229151352.6hzmjvu3qh6p2qgg@e107158-lin/
Signed-off-by: Jiri Olsa <[email protected]>
---
drivers/crypto/bcm/cipher.c | 2 +-
drivers/crypto/bcm/cipher.h | 4 ++--
drivers/crypto/bcm/util.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c
index 30390a7324b2..0e5537838ef3 100644
--- a/drivers/crypto/bcm/cipher.c
+++ b/drivers/crypto/bcm/cipher.c
@@ -42,7 +42,7 @@

/* ================= Device Structure ================== */

-struct device_private iproc_priv;
+struct bcm_device_private iproc_priv;

/* ==================== Parameters ===================== */

diff --git a/drivers/crypto/bcm/cipher.h b/drivers/crypto/bcm/cipher.h
index 0ad5892b445d..71281a3bdbdc 100644
--- a/drivers/crypto/bcm/cipher.h
+++ b/drivers/crypto/bcm/cipher.h
@@ -420,7 +420,7 @@ struct spu_hw {
u32 num_chan;
};

-struct device_private {
+struct bcm_device_private {
struct platform_device *pdev;

struct spu_hw spu;
@@ -467,6 +467,6 @@ struct device_private {
struct mbox_chan **mbox;
};

-extern struct device_private iproc_priv;
+extern struct bcm_device_private iproc_priv;

#endif
diff --git a/drivers/crypto/bcm/util.c b/drivers/crypto/bcm/util.c
index 2b304fc78059..77aeedb84055 100644
--- a/drivers/crypto/bcm/util.c
+++ b/drivers/crypto/bcm/util.c
@@ -348,7 +348,7 @@ char *spu_alg_name(enum spu_cipher_alg alg, enum spu_cipher_mode mode)
static ssize_t spu_debugfs_read(struct file *filp, char __user *ubuf,
size_t count, loff_t *offp)
{
- struct device_private *ipriv;
+ struct bcm_device_private *ipriv;
char *buf;
ssize_t ret, out_offset, out_count;
int i;
--
2.26.2


2021-01-05 10:53:41

by Qais Yousef

[permalink] [raw]
Subject: Re: [PATCH] crypto: Rename struct device_private to bcm_device_private

On 01/05/21 00:02, Jiri Olsa wrote:
> Renaming 'struct device_private' to 'struct bcm_device_private',
> because it clashes with 'struct device_private' from
> 'drivers/base/base.h'.
>
> While it's not a functional problem, it's causing two distinct
> type hierarchies in BTF data. It also breaks build with options:
> CONFIG_DEBUG_INFO_BTF=y
> CONFIG_CRYPTO_DEV_BCM_SPU=y
>
> as reported by Qais Yousef [1].
>
> [1] https://lore.kernel.org/lkml/20201229151352.6hzmjvu3qh6p2qgg@e107158-lin/
> Signed-off-by: Jiri Olsa <[email protected]>
> ---
> drivers/crypto/bcm/cipher.c | 2 +-
> drivers/crypto/bcm/cipher.h | 4 ++--
> drivers/crypto/bcm/util.c | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)

FWIW, I did reproduce this on v5.9 and v5.10 kernels too, worth adding a fixes
tag for stable to pick it up? v5.8 built fine when I tried.

Anyway, the patch looks good to me, thanks for the fix!

Tested-by: Qais Yousef <[email protected]>

Cheers

--
Qais Yousef

2021-01-14 06:49:12

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] crypto: Rename struct device_private to bcm_device_private

On Tue, Jan 05, 2021 at 12:02:37AM +0100, Jiri Olsa wrote:
> Renaming 'struct device_private' to 'struct bcm_device_private',
> because it clashes with 'struct device_private' from
> 'drivers/base/base.h'.
>
> While it's not a functional problem, it's causing two distinct
> type hierarchies in BTF data. It also breaks build with options:
> CONFIG_DEBUG_INFO_BTF=y
> CONFIG_CRYPTO_DEV_BCM_SPU=y
>
> as reported by Qais Yousef [1].
>
> [1] https://lore.kernel.org/lkml/20201229151352.6hzmjvu3qh6p2qgg@e107158-lin/
> Signed-off-by: Jiri Olsa <[email protected]>
> ---
> drivers/crypto/bcm/cipher.c | 2 +-
> drivers/crypto/bcm/cipher.h | 4 ++--
> drivers/crypto/bcm/util.c | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt