* [PATCH] scsi: ufs: Constify the third pwr_change_notify() argument
@ 2025-02-12 21:38 Bart Van Assche
2025-02-13 3:25 ` Martin K. Petersen
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Bart Van Assche @ 2025-02-12 21:38 UTC (permalink / raw)
To: Martin K . Petersen
Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley, Alim Akhtar,
Krzysztof Kozlowski, Peter Wang, Manivannan Sadhasivam,
Orson Zhai, Baolin Wang, Matthias Brugger,
AngeloGioacchino Del Regno, Bean Huo, Ziqi Chen,
Uwe Kleine-König, Adrian Hunter, Philipp Stanner, Minwoo Im,
Avri Altman, Eric Biggers
The third pwr_change_notify() argument is an input parameter. Make this
explicit by declaring it 'const'.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/ufs/core/ufshcd-priv.h | 6 +++---
drivers/ufs/host/ufs-exynos.c | 10 +++++-----
drivers/ufs/host/ufs-exynos.h | 2 +-
drivers/ufs/host/ufs-hisi.c | 6 +++---
drivers/ufs/host/ufs-mediatek.c | 10 +++++-----
drivers/ufs/host/ufs-qcom.c | 2 +-
drivers/ufs/host/ufs-sprd.c | 6 +++---
drivers/ufs/host/ufshcd-pci.c | 2 +-
include/ufs/ufshcd.h | 8 ++++----
9 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/drivers/ufs/core/ufshcd-priv.h b/drivers/ufs/core/ufshcd-priv.h
index 786f20ef2238..2cf500e74440 100644
--- a/drivers/ufs/core/ufshcd-priv.h
+++ b/drivers/ufs/core/ufshcd-priv.h
@@ -159,9 +159,9 @@ static inline int ufshcd_vops_link_startup_notify(struct ufs_hba *hba,
}
static inline int ufshcd_vops_pwr_change_notify(struct ufs_hba *hba,
- enum ufs_notify_change_status status,
- struct ufs_pa_layer_attr *dev_max_params,
- struct ufs_pa_layer_attr *dev_req_params)
+ enum ufs_notify_change_status status,
+ const struct ufs_pa_layer_attr *dev_max_params,
+ struct ufs_pa_layer_attr *dev_req_params)
{
if (hba->vops && hba->vops->pwr_change_notify)
return hba->vops->pwr_change_notify(hba, status,
diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c
index 13dd5dfc03eb..cab40d0cf1d5 100644
--- a/drivers/ufs/host/ufs-exynos.c
+++ b/drivers/ufs/host/ufs-exynos.c
@@ -321,7 +321,7 @@ static int exynosauto_ufs_pre_pwr_change(struct exynos_ufs *ufs,
}
static int exynosauto_ufs_post_pwr_change(struct exynos_ufs *ufs,
- struct ufs_pa_layer_attr *pwr)
+ const struct ufs_pa_layer_attr *pwr)
{
struct ufs_hba *hba = ufs->hba;
u32 enabled_vh;
@@ -396,7 +396,7 @@ static int exynos7_ufs_pre_pwr_change(struct exynos_ufs *ufs,
}
static int exynos7_ufs_post_pwr_change(struct exynos_ufs *ufs,
- struct ufs_pa_layer_attr *pwr)
+ const struct ufs_pa_layer_attr *pwr)
{
struct ufs_hba *hba = ufs->hba;
int lanes = max_t(u32, pwr->lane_rx, pwr->lane_tx);
@@ -813,7 +813,7 @@ static u32 exynos_ufs_get_hs_gear(struct ufs_hba *hba)
}
static int exynos_ufs_pre_pwr_mode(struct ufs_hba *hba,
- struct ufs_pa_layer_attr *dev_max_params,
+ const struct ufs_pa_layer_attr *dev_max_params,
struct ufs_pa_layer_attr *dev_req_params)
{
struct exynos_ufs *ufs = ufshcd_get_variant(hba);
@@ -865,7 +865,7 @@ static int exynos_ufs_pre_pwr_mode(struct ufs_hba *hba,
#define PWR_MODE_STR_LEN 64
static int exynos_ufs_post_pwr_mode(struct ufs_hba *hba,
- struct ufs_pa_layer_attr *pwr_req)
+ const struct ufs_pa_layer_attr *pwr_req)
{
struct exynos_ufs *ufs = ufshcd_get_variant(hba);
struct phy *generic_phy = ufs->phy;
@@ -1634,7 +1634,7 @@ static int exynos_ufs_link_startup_notify(struct ufs_hba *hba,
static int exynos_ufs_pwr_change_notify(struct ufs_hba *hba,
enum ufs_notify_change_status status,
- struct ufs_pa_layer_attr *dev_max_params,
+ const struct ufs_pa_layer_attr *dev_max_params,
struct ufs_pa_layer_attr *dev_req_params)
{
int ret = 0;
diff --git a/drivers/ufs/host/ufs-exynos.h b/drivers/ufs/host/ufs-exynos.h
index 9670dc138d1e..aac517276189 100644
--- a/drivers/ufs/host/ufs-exynos.h
+++ b/drivers/ufs/host/ufs-exynos.h
@@ -188,7 +188,7 @@ struct exynos_ufs_drv_data {
int (*pre_pwr_change)(struct exynos_ufs *ufs,
struct ufs_pa_layer_attr *pwr);
int (*post_pwr_change)(struct exynos_ufs *ufs,
- struct ufs_pa_layer_attr *pwr);
+ const struct ufs_pa_layer_attr *pwr);
int (*pre_hce_enable)(struct exynos_ufs *ufs);
int (*post_hce_enable)(struct exynos_ufs *ufs);
};
diff --git a/drivers/ufs/host/ufs-hisi.c b/drivers/ufs/host/ufs-hisi.c
index 6e6569de74d8..6f2e6bf31225 100644
--- a/drivers/ufs/host/ufs-hisi.c
+++ b/drivers/ufs/host/ufs-hisi.c
@@ -361,9 +361,9 @@ static void ufs_hisi_pwr_change_pre_change(struct ufs_hba *hba)
}
static int ufs_hisi_pwr_change_notify(struct ufs_hba *hba,
- enum ufs_notify_change_status status,
- struct ufs_pa_layer_attr *dev_max_params,
- struct ufs_pa_layer_attr *dev_req_params)
+ enum ufs_notify_change_status status,
+ const struct ufs_pa_layer_attr *dev_max_params,
+ struct ufs_pa_layer_attr *dev_req_params)
{
struct ufs_host_params host_params;
int ret = 0;
diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
index 135cd78109e2..927c0bcdb9a9 100644
--- a/drivers/ufs/host/ufs-mediatek.c
+++ b/drivers/ufs/host/ufs-mediatek.c
@@ -1081,8 +1081,8 @@ static bool ufs_mtk_pmc_via_fastauto(struct ufs_hba *hba,
}
static int ufs_mtk_pre_pwr_change(struct ufs_hba *hba,
- struct ufs_pa_layer_attr *dev_max_params,
- struct ufs_pa_layer_attr *dev_req_params)
+ const struct ufs_pa_layer_attr *dev_max_params,
+ struct ufs_pa_layer_attr *dev_req_params)
{
struct ufs_mtk_host *host = ufshcd_get_variant(hba);
struct ufs_host_params host_params;
@@ -1134,9 +1134,9 @@ static int ufs_mtk_pre_pwr_change(struct ufs_hba *hba,
}
static int ufs_mtk_pwr_change_notify(struct ufs_hba *hba,
- enum ufs_notify_change_status stage,
- struct ufs_pa_layer_attr *dev_max_params,
- struct ufs_pa_layer_attr *dev_req_params)
+ enum ufs_notify_change_status stage,
+ const struct ufs_pa_layer_attr *dev_max_params,
+ struct ufs_pa_layer_attr *dev_req_params)
{
int ret = 0;
diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index e69b792523e6..45eabccdfa31 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -807,7 +807,7 @@ static int ufs_qcom_icc_update_bw(struct ufs_qcom_host *host)
static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
enum ufs_notify_change_status status,
- struct ufs_pa_layer_attr *dev_max_params,
+ const struct ufs_pa_layer_attr *dev_max_params,
struct ufs_pa_layer_attr *dev_req_params)
{
struct ufs_qcom_host *host = ufshcd_get_variant(hba);
diff --git a/drivers/ufs/host/ufs-sprd.c b/drivers/ufs/host/ufs-sprd.c
index b1d532363f9d..65bd8fb96b99 100644
--- a/drivers/ufs/host/ufs-sprd.c
+++ b/drivers/ufs/host/ufs-sprd.c
@@ -160,9 +160,9 @@ static int ufs_sprd_common_init(struct ufs_hba *hba)
}
static int sprd_ufs_pwr_change_notify(struct ufs_hba *hba,
- enum ufs_notify_change_status status,
- struct ufs_pa_layer_attr *dev_max_params,
- struct ufs_pa_layer_attr *dev_req_params)
+ enum ufs_notify_change_status status,
+ const struct ufs_pa_layer_attr *dev_max_params,
+ struct ufs_pa_layer_attr *dev_req_params)
{
struct ufs_sprd_host *host = ufshcd_get_variant(hba);
diff --git a/drivers/ufs/host/ufshcd-pci.c b/drivers/ufs/host/ufshcd-pci.c
index ea39c5d5b8cf..2245397a9cc2 100644
--- a/drivers/ufs/host/ufshcd-pci.c
+++ b/drivers/ufs/host/ufshcd-pci.c
@@ -157,7 +157,7 @@ static int ufs_intel_set_lanes(struct ufs_hba *hba, u32 lanes)
static int ufs_intel_lkf_pwr_change_notify(struct ufs_hba *hba,
enum ufs_notify_change_status status,
- struct ufs_pa_layer_attr *dev_max_params,
+ const struct ufs_pa_layer_attr *dev_max_params,
struct ufs_pa_layer_attr *dev_req_params)
{
int err = 0;
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index 1ddc1edf31b1..b9e8cc87c026 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -353,9 +353,9 @@ struct ufs_hba_variant_ops {
int (*link_startup_notify)(struct ufs_hba *,
enum ufs_notify_change_status);
int (*pwr_change_notify)(struct ufs_hba *,
- enum ufs_notify_change_status status,
- struct ufs_pa_layer_attr *desired_pwr_mode,
- struct ufs_pa_layer_attr *final_params);
+ enum ufs_notify_change_status status,
+ const struct ufs_pa_layer_attr *desired_pwr_mode,
+ struct ufs_pa_layer_attr *final_params);
void (*setup_xfer_req)(struct ufs_hba *hba, int tag,
bool is_scsi_cmd);
void (*setup_task_mgmt)(struct ufs_hba *, int, u8);
@@ -1422,7 +1422,7 @@ static inline int ufshcd_dme_peer_get(struct ufs_hba *hba,
return ufshcd_dme_get_attr(hba, attr_sel, mib_val, DME_PEER);
}
-static inline bool ufshcd_is_hs_mode(struct ufs_pa_layer_attr *pwr_info)
+static inline bool ufshcd_is_hs_mode(const struct ufs_pa_layer_attr *pwr_info)
{
return (pwr_info->pwr_rx == FAST_MODE ||
pwr_info->pwr_rx == FASTAUTO_MODE) &&
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: ufs: Constify the third pwr_change_notify() argument
2025-02-12 21:38 [PATCH] scsi: ufs: Constify the third pwr_change_notify() argument Bart Van Assche
@ 2025-02-13 3:25 ` Martin K. Petersen
2025-02-13 10:57 ` Peter Wang (王信友)
2025-02-19 1:06 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2025-02-13 3:25 UTC (permalink / raw)
To: Bart Van Assche
Cc: Martin K . Petersen, linux-scsi, James E.J. Bottomley,
Alim Akhtar, Krzysztof Kozlowski, Peter Wang,
Manivannan Sadhasivam, Orson Zhai, Baolin Wang, Matthias Brugger,
AngeloGioacchino Del Regno, Bean Huo, Ziqi Chen,
Uwe Kleine-König, Adrian Hunter, Philipp Stanner, Minwoo Im,
Avri Altman, Eric Biggers
Bart,
> The third pwr_change_notify() argument is an input parameter. Make
> this explicit by declaring it 'const'.
Applied to 6.15/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: ufs: Constify the third pwr_change_notify() argument
2025-02-12 21:38 [PATCH] scsi: ufs: Constify the third pwr_change_notify() argument Bart Van Assche
2025-02-13 3:25 ` Martin K. Petersen
@ 2025-02-13 10:57 ` Peter Wang (王信友)
2025-02-19 1:06 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Peter Wang (王信友) @ 2025-02-13 10:57 UTC (permalink / raw)
To: bvanassche@acm.org, martin.petersen@oracle.com
Cc: baolin.wang@linux.alibaba.com, ebiggers@google.com,
James.Bottomley@HansenPartnership.com, quic_ziqichen@quicinc.com,
pstanner@redhat.com, adrian.hunter@intel.com,
linux-scsi@vger.kernel.org, AngeloGioacchino Del Regno,
beanhuo@micron.com, manivannan.sadhasivam@linaro.org,
alim.akhtar@samsung.com, u.kleine-koenig@baylibre.com,
krzk@kernel.org, orsonzhai@gmail.com, minwoo.im@samsung.com,
matthias.bgg@gmail.com, avri.altman@wdc.com
On Wed, 2025-02-12 at 13:38 -0800, Bart Van Assche wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
>
> The third pwr_change_notify() argument is an input parameter. Make
> this
> explicit by declaring it 'const'.
>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
> drivers/ufs/core/ufshcd-priv.h | 6 +++---
> drivers/ufs/host/ufs-exynos.c | 10 +++++-----
> drivers/ufs/host/ufs-exynos.h | 2 +-
> drivers/ufs/host/ufs-hisi.c | 6 +++---
> drivers/ufs/host/ufs-mediatek.c | 10 +++++-----
> drivers/ufs/host/ufs-qcom.c | 2 +-
> drivers/ufs/host/ufs-sprd.c | 6 +++---
> drivers/ufs/host/ufshcd-pci.c | 2 +-
> include/ufs/ufshcd.h | 8 ++++----
> 9 files changed, 26 insertions(+), 26 deletions(-)
>
>
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: ufs: Constify the third pwr_change_notify() argument
2025-02-12 21:38 [PATCH] scsi: ufs: Constify the third pwr_change_notify() argument Bart Van Assche
2025-02-13 3:25 ` Martin K. Petersen
2025-02-13 10:57 ` Peter Wang (王信友)
@ 2025-02-19 1:06 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2025-02-19 1:06 UTC (permalink / raw)
To: Bart Van Assche
Cc: Martin K . Petersen, linux-scsi, James E.J. Bottomley,
Alim Akhtar, Krzysztof Kozlowski, Peter Wang,
Manivannan Sadhasivam, Orson Zhai, Baolin Wang, Matthias Brugger,
AngeloGioacchino Del Regno, Bean Huo, Ziqi Chen,
Uwe Kleine-König, Adrian Hunter, Philipp Stanner, Minwoo Im,
Avri Altman, Eric Biggers
On Wed, 12 Feb 2025 13:38:02 -0800, Bart Van Assche wrote:
> The third pwr_change_notify() argument is an input parameter. Make this
> explicit by declaring it 'const'.
>
>
Applied to 6.15/scsi-queue, thanks!
[1/1] scsi: ufs: Constify the third pwr_change_notify() argument
https://git.kernel.org/mkp/scsi/c/3bcd901e4257
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-19 1:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-12 21:38 [PATCH] scsi: ufs: Constify the third pwr_change_notify() argument Bart Van Assche
2025-02-13 3:25 ` Martin K. Petersen
2025-02-13 10:57 ` Peter Wang (王信友)
2025-02-19 1:06 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox