Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH] soc: qcom: pmic_glink: remove redundant calculation of svid
@ 2023-02-06 13:58 Tom Rix
  2023-02-06 22:30 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Rix @ 2023-02-06 13:58 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio; +Cc: linux-arm-msm, linux-kernel, Tom Rix

gcc with W=1 reports
drivers/soc/qcom/pmic_glink_altmode.c:223:13: error: variable ‘svid’ set but not used [-Werror=unused-but-set-variable]
  223 |         u16 svid;

From reviewing the code, the setting of alt_port->svid does the same calculation.
Both are not needed.  For debuggablity, keep the setting of local svid.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/soc/qcom/pmic_glink_altmode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/pmic_glink_altmode.c b/drivers/soc/qcom/pmic_glink_altmode.c
index 71f861b8cb51..4d7895bdeaf2 100644
--- a/drivers/soc/qcom/pmic_glink_altmode.c
+++ b/drivers/soc/qcom/pmic_glink_altmode.c
@@ -248,7 +248,7 @@ static void pmic_glink_altmode_sc8180xp_notify(struct pmic_glink_altmode *altmod
 
 	alt_port = &altmode->ports[port];
 	alt_port->orientation = pmic_glink_altmode_orientation(orientation);
-	alt_port->svid = mux == 2 ? USB_TYPEC_DP_SID : 0;
+	alt_port->svid = svid;
 	alt_port->mode = mode;
 	alt_port->hpd_state = hpd_state;
 	alt_port->hpd_irq = hpd_irq;
-- 
2.26.3


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

* Re: [PATCH] soc: qcom: pmic_glink: remove redundant calculation of svid
  2023-02-06 13:58 [PATCH] soc: qcom: pmic_glink: remove redundant calculation of svid Tom Rix
@ 2023-02-06 22:30 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2023-02-06 22:30 UTC (permalink / raw)
  To: agross, Tom Rix, konrad.dybcio; +Cc: linux-kernel, linux-arm-msm

On Mon, 6 Feb 2023 05:58:31 -0800, Tom Rix wrote:
> gcc with W=1 reports
> drivers/soc/qcom/pmic_glink_altmode.c:223:13: error: variable ‘svid’ set but not used [-Werror=unused-but-set-variable]
>   223 |         u16 svid;
> 
> From reviewing the code, the setting of alt_port->svid does the same calculation.
> Both are not needed.  For debuggablity, keep the setting of local svid.
> 
> [...]

Applied, thanks!

[1/1] soc: qcom: pmic_glink: remove redundant calculation of svid
      commit: dcb4e7a57cbe8d85e4927f517ae28aab17596419

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

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

end of thread, other threads:[~2023-02-06 22:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-06 13:58 [PATCH] soc: qcom: pmic_glink: remove redundant calculation of svid Tom Rix
2023-02-06 22:30 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox