diff mbox series

scsi: ufs: qcom: Make struct ufs_qcom_bw_table static const

Message ID 20230802040154.10652-1-manivannan.sadhasivam@linaro.org
State New
Headers show
Series scsi: ufs: qcom: Make struct ufs_qcom_bw_table static const | expand

Commit Message

Manivannan Sadhasivam Aug. 2, 2023, 4:01 a.m. UTC
ufs_qcom_bw_table is not modified anywhere. So make it static const so that
it can be placed in read-only memory.

Reported-by: Bart Van Assche <bvanassche@acm.org>
Closes: https://lore.kernel.org/linux-scsi/43cd0057-c6d8-bc92-08f4-d767336d2cfe@acm.org/
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/ufs/host/ufs-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bart Van Assche Aug. 2, 2023, 3:56 p.m. UTC | #1
On 8/1/23 21:01, Manivannan Sadhasivam wrote:
> ufs_qcom_bw_table is not modified anywhere. So make it static const so that
> it can be placed in read-only memory.
> 
> Reported-by: Bart Van Assche <bvanassche@acm.org>
> Closes: https://lore.kernel.org/linux-scsi/43cd0057-c6d8-bc92-08f4-d767336d2cfe@acm.org/
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>   drivers/ufs/host/ufs-qcom.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 75a1fd295f34..0341c025e818 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -58,7 +58,7 @@ enum {
>   	MODE_MAX,
>   };
>   
> -struct __ufs_qcom_bw_table {
> +static const struct __ufs_qcom_bw_table {
>   	u32 mem_bw;
>   	u32 cfg_bw;
>   } ufs_qcom_bw_table[MODE_MAX + 1][QCOM_UFS_MAX_GEAR + 1][QCOM_UFS_MAX_LANE + 1] = {

Thanks!

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Martin K. Petersen Aug. 8, 2023, 1:13 a.m. UTC | #2
Manivannan,

> ufs_qcom_bw_table is not modified anywhere. So make it static const so that
> it can be placed in read-only memory.

Applied to 6.6/scsi-staging, thanks!
Martin K. Petersen Aug. 21, 2023, 10:27 p.m. UTC | #3
On Wed, 02 Aug 2023 09:31:54 +0530, Manivannan Sadhasivam wrote:

> ufs_qcom_bw_table is not modified anywhere. So make it static const so that
> it can be placed in read-only memory.
> 
> 

Applied to 6.6/scsi-queue, thanks!

[1/1] scsi: ufs: qcom: Make struct ufs_qcom_bw_table static const
      https://git.kernel.org/mkp/scsi/c/01e747157b61
diff mbox series

Patch

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 75a1fd295f34..0341c025e818 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -58,7 +58,7 @@  enum {
 	MODE_MAX,
 };
 
-struct __ufs_qcom_bw_table {
+static const struct __ufs_qcom_bw_table {
 	u32 mem_bw;
 	u32 cfg_bw;
 } ufs_qcom_bw_table[MODE_MAX + 1][QCOM_UFS_MAX_GEAR + 1][QCOM_UFS_MAX_LANE + 1] = {