2023-03-13 18:32:40

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 29/36] crypto: hisilicon/qm - make struct bus_type * const

In the function, qm_get_qos_value(), a struct bus_type * is used, but it
really should be a const pointer as it is not modified anywhere in the
function, and the driver core function it is used in expects a constant
pointer.

Cc: Weili Qian <[email protected]>
Cc: Zhou Wang <[email protected]>
Cc: Herbert Xu <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: [email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
Note, this is a patch that is a prepatory cleanup as part of a larger
series of patches that is working on resolving some old driver core
design mistakes. It will build and apply cleanly on top of 6.3-rc2 on
its own, but I'd prefer if I could take it through my driver-core tree
so that the driver core changes can be taken through there for 6.4-rc1.

drivers/crypto/hisilicon/qm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index e4c84433a88a..fd1a38ee55f8 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -3691,7 +3691,7 @@ static ssize_t qm_get_qos_value(struct hisi_qm *qm, const char *buf,
unsigned long *val,
unsigned int *fun_index)
{
- struct bus_type *bus_type = qm->pdev->dev.bus;
+ const struct bus_type *bus_type = qm->pdev->dev.bus;
char tbuf_bdf[QM_DBG_READ_LEN] = {0};
char val_buf[QM_DBG_READ_LEN] = {0};
struct pci_dev *pdev;
--
2.39.2



2023-03-14 08:25:33

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 29/36] crypto: hisilicon/qm - make struct bus_type * const

On Mon, Mar 13, 2023 at 07:29:11PM +0100, Greg Kroah-Hartman wrote:
> In the function, qm_get_qos_value(), a struct bus_type * is used, but it
> really should be a const pointer as it is not modified anywhere in the
> function, and the driver core function it is used in expects a constant
> pointer.
>
> Cc: Weili Qian <[email protected]>
> Cc: Zhou Wang <[email protected]>
> Cc: Herbert Xu <[email protected]>
> Cc: "David S. Miller" <[email protected]>
> Cc: [email protected]
> Signed-off-by: Greg Kroah-Hartman <[email protected]>
> ---
> Note, this is a patch that is a prepatory cleanup as part of a larger
> series of patches that is working on resolving some old driver core
> design mistakes. It will build and apply cleanly on top of 6.3-rc2 on
> its own, but I'd prefer if I could take it through my driver-core tree
> so that the driver core changes can be taken through there for 6.4-rc1.
>
> drivers/crypto/hisilicon/qm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

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