All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] scsi: core: Cleanup struct ufs_saved_pwr_info
@ 2023-03-30  1:29 Stanley Chu
  2023-03-30  6:36 ` Avri Altman
  2023-04-03  1:15 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Stanley Chu @ 2023-03-30  1:29 UTC (permalink / raw)
  To: linux-scsi, linux-kernel, martin.petersen, avri.altman,
	alim.akhtar, jejb, bvanassche
  Cc: stanley.chu

The "is_valid" field of the struct ufs_saved_pwr_info is no
longer used, and this struct can be replaced by struct
ufs_pa_layer_attr, without any changes to the functionality.

Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
---
 drivers/ufs/core/ufshcd.c | 7 +++----
 include/ufs/ufshcd.h      | 7 +------
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index c32a927ac5d1..97eb28a3006d 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -1269,7 +1269,7 @@ static int ufshcd_scale_gear(struct ufs_hba *hba, bool scale_up)
 	struct ufs_pa_layer_attr new_pwr_info;
 
 	if (scale_up) {
-		memcpy(&new_pwr_info, &hba->clk_scaling.saved_pwr_info.info,
+		memcpy(&new_pwr_info, &hba->clk_scaling.saved_pwr_info,
 		       sizeof(struct ufs_pa_layer_attr));
 	} else {
 		memcpy(&new_pwr_info, &hba->pwr_info,
@@ -1278,7 +1278,7 @@ static int ufshcd_scale_gear(struct ufs_hba *hba, bool scale_up)
 		if (hba->pwr_info.gear_tx > hba->clk_scaling.min_gear ||
 		    hba->pwr_info.gear_rx > hba->clk_scaling.min_gear) {
 			/* save the current power mode */
-			memcpy(&hba->clk_scaling.saved_pwr_info.info,
+			memcpy(&hba->clk_scaling.saved_pwr_info,
 				&hba->pwr_info,
 				sizeof(struct ufs_pa_layer_attr));
 
@@ -8424,10 +8424,9 @@ static int ufshcd_add_lus(struct ufs_hba *hba)
 
 	/* Initialize devfreq after UFS device is detected */
 	if (ufshcd_is_clkscaling_supported(hba)) {
-		memcpy(&hba->clk_scaling.saved_pwr_info.info,
+		memcpy(&hba->clk_scaling.saved_pwr_info,
 			&hba->pwr_info,
 			sizeof(struct ufs_pa_layer_attr));
-		hba->clk_scaling.saved_pwr_info.is_valid = true;
 		hba->clk_scaling.is_allowed = true;
 
 		ret = ufshcd_devfreq_init(hba);
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index 431c3afb2ce0..2845fe7f45cd 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -394,11 +394,6 @@ struct ufs_clk_gating {
 	struct workqueue_struct *clk_gating_workq;
 };
 
-struct ufs_saved_pwr_info {
-	struct ufs_pa_layer_attr info;
-	bool is_valid;
-};
-
 /**
  * struct ufs_clk_scaling - UFS clock scaling related data
  * @active_reqs: number of requests that are pending. If this is zero when
@@ -428,7 +423,7 @@ struct ufs_clk_scaling {
 	ktime_t window_start_t;
 	ktime_t busy_start_t;
 	struct device_attribute enable_attr;
-	struct ufs_saved_pwr_info saved_pwr_info;
+	struct ufs_pa_layer_attr saved_pwr_info;
 	struct workqueue_struct *workq;
 	struct work_struct suspend_work;
 	struct work_struct resume_work;
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH v1] scsi: core: Cleanup struct ufs_saved_pwr_info
  2023-03-30  1:29 [PATCH v1] scsi: core: Cleanup struct ufs_saved_pwr_info Stanley Chu
@ 2023-03-30  6:36 ` Avri Altman
  2023-04-03  1:15 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Avri Altman @ 2023-03-30  6:36 UTC (permalink / raw)
  To: Stanley Chu, linux-scsi, linux-kernel, martin.petersen,
	alim.akhtar, jejb, bvanassche

> 
> The "is_valid" field of the struct ufs_saved_pwr_info is no longer used, and
> this struct can be replaced by struct ufs_pa_layer_attr, without any changes
> to the functionality.
> 
> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] scsi: core: Cleanup struct ufs_saved_pwr_info
  2023-03-30  1:29 [PATCH v1] scsi: core: Cleanup struct ufs_saved_pwr_info Stanley Chu
  2023-03-30  6:36 ` Avri Altman
@ 2023-04-03  1:15 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2023-04-03  1:15 UTC (permalink / raw)
  To: Stanley Chu
  Cc: linux-scsi, linux-kernel, martin.petersen, avri.altman,
	alim.akhtar, jejb, bvanassche


Stanley,

> The "is_valid" field of the struct ufs_saved_pwr_info is no longer
> used, and this struct can be replaced by struct ufs_pa_layer_attr,
> without any changes to the functionality.

Applied to 6.4/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-03  1:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30  1:29 [PATCH v1] scsi: core: Cleanup struct ufs_saved_pwr_info Stanley Chu
2023-03-30  6:36 ` Avri Altman
2023-04-03  1:15 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.