public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/3] phy: apple: atc: Make atcphy_dwc3_reset_ops variable static
@ 2026-02-16 11:04 Krzysztof Kozlowski
  2026-02-16 11:04 ` [PATCH 2/3] phy: marvell: mmp3-hsic: Avoid re-casting __iomem Krzysztof Kozlowski
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-16 11:04 UTC (permalink / raw)
  To: Sven Peter, Janne Grunau, Neal Gompa, Vinod Koul, Neil Armstrong,
	Philipp Zabel, asahi, linux-arm-kernel, linux-phy, linux-kernel,
	linux-arm-msm
  Cc: Krzysztof Kozlowski

File-scope 'atcphy_dwc3_reset_ops' is not used outside of this unit, so
make it static to silence sparse warning:

  atc.c:2026:32: warning: symbol 'atcphy_dwc3_reset_ops' was not declared. Should it be static?

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
 drivers/phy/apple/atc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/apple/atc.c b/drivers/phy/apple/atc.c
index dc867f368b68..32d97226e926 100644
--- a/drivers/phy/apple/atc.c
+++ b/drivers/phy/apple/atc.c
@@ -2023,7 +2023,7 @@ static int atcphy_dwc3_reset_deassert(struct reset_controller_dev *rcdev, unsign
 	return 0;
 }
 
-const struct reset_control_ops atcphy_dwc3_reset_ops = {
+static const struct reset_control_ops atcphy_dwc3_reset_ops = {
 	.assert = atcphy_dwc3_reset_assert,
 	.deassert = atcphy_dwc3_reset_deassert,
 };
-- 
2.51.0



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

* [PATCH 2/3] phy: marvell: mmp3-hsic: Avoid re-casting __iomem
  2026-02-16 11:04 [PATCH 1/3] phy: apple: atc: Make atcphy_dwc3_reset_ops variable static Krzysztof Kozlowski
@ 2026-02-16 11:04 ` Krzysztof Kozlowski
  2026-02-16 11:04 ` [PATCH 3/3] phy: qcom: qmp-usbc: Simplify check for non-NULL pointer Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-16 11:04 UTC (permalink / raw)
  To: Sven Peter, Janne Grunau, Neal Gompa, Vinod Koul, Neil Armstrong,
	Philipp Zabel, asahi, linux-arm-kernel, linux-phy, linux-kernel,
	linux-arm-msm
  Cc: Krzysztof Kozlowski

__iomem annotated memory must be accessed via dedicated accessors, even
if actual code is correct (accessing the driver data in
mmp3_hsic_phy_init() brings back the __iomem cast), but dropping its
cast (with or without __force) when storing as driver data seems like
less readable code for any future changes.  Instead, add a dedicated
wrapping structure just to hold the pointer without changing the __iomem
cast.  This makes the code explicit, obvious and solves the sparse
warning:

  phy-mmp3-hsic.c:58:31: warning: cast removes address space '__iomem' of expression

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
 drivers/phy/marvell/phy-mmp3-hsic.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/phy/marvell/phy-mmp3-hsic.c b/drivers/phy/marvell/phy-mmp3-hsic.c
index 271f1a2258ef..72ab6da0ebc3 100644
--- a/drivers/phy/marvell/phy-mmp3-hsic.c
+++ b/drivers/phy/marvell/phy-mmp3-hsic.c
@@ -14,15 +14,19 @@
 #define HSIC_ENABLE	BIT(7)
 #define PLL_BYPASS	BIT(4)
 
+struct mmp3_hsic_data {
+	void __iomem *base;
+};
+
 static int mmp3_hsic_phy_init(struct phy *phy)
 {
-	void __iomem *base = (void __iomem *)phy_get_drvdata(phy);
+	struct mmp3_hsic_data *mmp3 = phy_get_drvdata(phy);
 	u32 hsic_ctrl;
 
-	hsic_ctrl = readl_relaxed(base + HSIC_CTRL);
+	hsic_ctrl = readl_relaxed(mmp3->base + HSIC_CTRL);
 	hsic_ctrl |= HSIC_ENABLE;
 	hsic_ctrl |= PLL_BYPASS;
-	writel_relaxed(hsic_ctrl, base + HSIC_CTRL);
+	writel_relaxed(hsic_ctrl, mmp3->base + HSIC_CTRL);
 
 	return 0;
 }
@@ -41,13 +45,17 @@ MODULE_DEVICE_TABLE(of, mmp3_hsic_phy_of_match);
 static int mmp3_hsic_phy_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
+	struct mmp3_hsic_data *mmp3;
 	struct phy_provider *provider;
-	void __iomem *base;
 	struct phy *phy;
 
-	base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
-	if (IS_ERR(base))
-		return PTR_ERR(base);
+	mmp3 = devm_kzalloc(dev, sizeof(*mmp3), GFP_KERNEL);
+	if (!mmp3)
+		return -ENOMEM;
+
+	mmp3->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
+	if (IS_ERR(mmp3->base))
+		return PTR_ERR(mmp3->base);
 
 	phy = devm_phy_create(dev, NULL, &mmp3_hsic_phy_ops);
 	if (IS_ERR(phy)) {
@@ -55,7 +63,7 @@ static int mmp3_hsic_phy_probe(struct platform_device *pdev)
 		return PTR_ERR(phy);
 	}
 
-	phy_set_drvdata(phy, (void *)base);
+	phy_set_drvdata(phy, mmp3);
 	provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
 	if (IS_ERR(provider)) {
 		dev_err(dev, "failed to register PHY provider\n");
-- 
2.51.0



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

* [PATCH 3/3] phy: qcom: qmp-usbc: Simplify check for non-NULL pointer
  2026-02-16 11:04 [PATCH 1/3] phy: apple: atc: Make atcphy_dwc3_reset_ops variable static Krzysztof Kozlowski
  2026-02-16 11:04 ` [PATCH 2/3] phy: marvell: mmp3-hsic: Avoid re-casting __iomem Krzysztof Kozlowski
@ 2026-02-16 11:04 ` Krzysztof Kozlowski
  2026-02-16 11:33   ` Konrad Dybcio
                     ` (2 more replies)
  2026-02-24  7:57 ` [PATCH 1/3] phy: apple: atc: Make atcphy_dwc3_reset_ops variable static Janne Grunau
  2026-02-27 15:29 ` Vinod Koul
  3 siblings, 3 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-16 11:04 UTC (permalink / raw)
  To: Sven Peter, Janne Grunau, Neal Gompa, Vinod Koul, Neil Armstrong,
	Philipp Zabel, asahi, linux-arm-kernel, linux-phy, linux-kernel,
	linux-arm-msm
  Cc: Krzysztof Kozlowski

Pointers should not use explicit '0' comparison, so just use standard
evaluation as non-NULL:

  phy-qcom-qmp-usbc.c:1682:31: warning: Using plain integer as NULL pointer

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
 drivers/phy/qualcomm/phy-qcom-qmp-usbc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c b/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c
index 14feb77789b3..c342479a3798 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-usbc.c
@@ -1679,7 +1679,7 @@ static int qmp_usbc_register_clocks(struct qmp_usbc *qmp, struct device_node *np
 	if (ret)
 		return ret;
 
-	if (qmp->dp_serdes != 0) {
+	if (qmp->dp_serdes) {
 		ret = phy_dp_clks_register(qmp, np);
 		if (ret)
 			return ret;
@@ -1833,7 +1833,7 @@ static int qmp_usbc_parse_dt(struct qmp_usbc *qmp)
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-	if (offs->dp_serdes != 0) {
+	if (offs->dp_serdes) {
 		qmp->dp_serdes = base + offs->dp_serdes;
 		qmp->dp_tx = base + offs->dp_txa;
 		qmp->dp_tx2 = base + offs->dp_txb;
@@ -1982,7 +1982,7 @@ static int qmp_usbc_probe(struct platform_device *pdev)
 
 	phy_set_drvdata(qmp->usb_phy, qmp);
 
-	if (qmp->dp_serdes != 0) {
+	if (qmp->dp_serdes) {
 		qmp->dp_phy = devm_phy_create(dev, np, &qmp_usbc_dp_phy_ops);
 		if (IS_ERR(qmp->dp_phy)) {
 			ret = PTR_ERR(qmp->dp_phy);
-- 
2.51.0



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

* Re: [PATCH 3/3] phy: qcom: qmp-usbc: Simplify check for non-NULL pointer
  2026-02-16 11:04 ` [PATCH 3/3] phy: qcom: qmp-usbc: Simplify check for non-NULL pointer Krzysztof Kozlowski
@ 2026-02-16 11:33   ` Konrad Dybcio
  2026-02-16 14:58   ` Abel Vesa
  2026-02-24  7:47   ` Dmitry Baryshkov
  2 siblings, 0 replies; 8+ messages in thread
From: Konrad Dybcio @ 2026-02-16 11:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Sven Peter, Janne Grunau, Neal Gompa,
	Vinod Koul, Neil Armstrong, Philipp Zabel, asahi,
	linux-arm-kernel, linux-phy, linux-kernel, linux-arm-msm

On 2/16/26 12:04 PM, Krzysztof Kozlowski wrote:
> Pointers should not use explicit '0' comparison, so just use standard
> evaluation as non-NULL:
> 
>   phy-qcom-qmp-usbc.c:1682:31: warning: Using plain integer as NULL pointer
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad


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

* Re: [PATCH 3/3] phy: qcom: qmp-usbc: Simplify check for non-NULL pointer
  2026-02-16 11:04 ` [PATCH 3/3] phy: qcom: qmp-usbc: Simplify check for non-NULL pointer Krzysztof Kozlowski
  2026-02-16 11:33   ` Konrad Dybcio
@ 2026-02-16 14:58   ` Abel Vesa
  2026-02-24  7:47   ` Dmitry Baryshkov
  2 siblings, 0 replies; 8+ messages in thread
From: Abel Vesa @ 2026-02-16 14:58 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Sven Peter, Janne Grunau, Neal Gompa, Vinod Koul, Neil Armstrong,
	Philipp Zabel, asahi, linux-arm-kernel, linux-phy, linux-kernel,
	linux-arm-msm

On 26-02-16 12:04:16, Krzysztof Kozlowski wrote:
> Pointers should not use explicit '0' comparison, so just use standard
> evaluation as non-NULL:
> 
>   phy-qcom-qmp-usbc.c:1682:31: warning: Using plain integer as NULL pointer
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>


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

* Re: [PATCH 3/3] phy: qcom: qmp-usbc: Simplify check for non-NULL pointer
  2026-02-16 11:04 ` [PATCH 3/3] phy: qcom: qmp-usbc: Simplify check for non-NULL pointer Krzysztof Kozlowski
  2026-02-16 11:33   ` Konrad Dybcio
  2026-02-16 14:58   ` Abel Vesa
@ 2026-02-24  7:47   ` Dmitry Baryshkov
  2 siblings, 0 replies; 8+ messages in thread
From: Dmitry Baryshkov @ 2026-02-24  7:47 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Sven Peter, Janne Grunau, Neal Gompa, Vinod Koul, Neil Armstrong,
	Philipp Zabel, asahi, linux-arm-kernel, linux-phy, linux-kernel,
	linux-arm-msm

On Mon, Feb 16, 2026 at 12:04:16PM +0100, Krzysztof Kozlowski wrote:
> Pointers should not use explicit '0' comparison, so just use standard
> evaluation as non-NULL:
> 
>   phy-qcom-qmp-usbc.c:1682:31: warning: Using plain integer as NULL pointer
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
>  drivers/phy/qualcomm/phy-qcom-qmp-usbc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry


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

* Re: [PATCH 1/3] phy: apple: atc: Make atcphy_dwc3_reset_ops variable static
  2026-02-16 11:04 [PATCH 1/3] phy: apple: atc: Make atcphy_dwc3_reset_ops variable static Krzysztof Kozlowski
  2026-02-16 11:04 ` [PATCH 2/3] phy: marvell: mmp3-hsic: Avoid re-casting __iomem Krzysztof Kozlowski
  2026-02-16 11:04 ` [PATCH 3/3] phy: qcom: qmp-usbc: Simplify check for non-NULL pointer Krzysztof Kozlowski
@ 2026-02-24  7:57 ` Janne Grunau
  2026-02-27 15:29 ` Vinod Koul
  3 siblings, 0 replies; 8+ messages in thread
From: Janne Grunau @ 2026-02-24  7:57 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Sven Peter, Neal Gompa, Vinod Koul, Neil Armstrong, Philipp Zabel,
	asahi, linux-arm-kernel, linux-phy, linux-kernel, linux-arm-msm

On Mon, Feb 16, 2026 at 12:04:14PM +0100, Krzysztof Kozlowski wrote:
> File-scope 'atcphy_dwc3_reset_ops' is not used outside of this unit, so
> make it static to silence sparse warning:
> 
>   atc.c:2026:32: warning: symbol 'atcphy_dwc3_reset_ops' was not declared. Should it be static?
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
>  drivers/phy/apple/atc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/apple/atc.c b/drivers/phy/apple/atc.c
> index dc867f368b68..32d97226e926 100644
> --- a/drivers/phy/apple/atc.c
> +++ b/drivers/phy/apple/atc.c
> @@ -2023,7 +2023,7 @@ static int atcphy_dwc3_reset_deassert(struct reset_controller_dev *rcdev, unsign
>  	return 0;
>  }
>  
> -const struct reset_control_ops atcphy_dwc3_reset_ops = {
> +static const struct reset_control_ops atcphy_dwc3_reset_ops = {
>  	.assert = atcphy_dwc3_reset_assert,
>  	.deassert = atcphy_dwc3_reset_deassert,
>  };

Reviewed-by: Janne Grunau <j@jannau.net>

thanks

Janne


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

* Re: [PATCH 1/3] phy: apple: atc: Make atcphy_dwc3_reset_ops variable static
  2026-02-16 11:04 [PATCH 1/3] phy: apple: atc: Make atcphy_dwc3_reset_ops variable static Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2026-02-24  7:57 ` [PATCH 1/3] phy: apple: atc: Make atcphy_dwc3_reset_ops variable static Janne Grunau
@ 2026-02-27 15:29 ` Vinod Koul
  3 siblings, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2026-02-27 15:29 UTC (permalink / raw)
  To: Sven Peter, Janne Grunau, Neal Gompa, Neil Armstrong,
	Philipp Zabel, asahi, linux-arm-kernel, linux-phy, linux-kernel,
	linux-arm-msm, Krzysztof Kozlowski


On Mon, 16 Feb 2026 12:04:14 +0100, Krzysztof Kozlowski wrote:
> File-scope 'atcphy_dwc3_reset_ops' is not used outside of this unit, so
> make it static to silence sparse warning:
> 
>   atc.c:2026:32: warning: symbol 'atcphy_dwc3_reset_ops' was not declared. Should it be static?
> 
> 

Applied, thanks!

[1/3] phy: apple: atc: Make atcphy_dwc3_reset_ops variable static
      commit: b3fddddf3fb49c7472e73680d6ea5d771f9514e8
[2/3] phy: marvell: mmp3-hsic: Avoid re-casting __iomem
      commit: c77eee5b44b8d32d471cf17fa193b395e321ef37
[3/3] phy: qcom: qmp-usbc: Simplify check for non-NULL pointer
      commit: b6b7d1ae0653dcaa356be31c0de221311e922ccd

Best regards,
-- 
~Vinod




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

end of thread, other threads:[~2026-02-27 15:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-16 11:04 [PATCH 1/3] phy: apple: atc: Make atcphy_dwc3_reset_ops variable static Krzysztof Kozlowski
2026-02-16 11:04 ` [PATCH 2/3] phy: marvell: mmp3-hsic: Avoid re-casting __iomem Krzysztof Kozlowski
2026-02-16 11:04 ` [PATCH 3/3] phy: qcom: qmp-usbc: Simplify check for non-NULL pointer Krzysztof Kozlowski
2026-02-16 11:33   ` Konrad Dybcio
2026-02-16 14:58   ` Abel Vesa
2026-02-24  7:47   ` Dmitry Baryshkov
2026-02-24  7:57 ` [PATCH 1/3] phy: apple: atc: Make atcphy_dwc3_reset_ops variable static Janne Grunau
2026-02-27 15:29 ` Vinod Koul

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