mmc: omap_hsmmc: don't print uninitialized variables
Subsystems (2)
PATCH v2 1/1 mmc: omap_hsmmc: don't print uninitialized variables
When DT based probing is used but the DMA request fails, the driver will print uninitialized stack data from the rx_req and tx_req variables, as indicated by this warning:
drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_probe':drivers/mmc/host/omap_hsmmc.c:2162:3: warning: 'rx_req' may be used uninitialized in this function [-Wmaybe-uninitialized]
dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req);
This removes the DMA request line number from the warning, which is the easiest solution and won't hurt us any more as we are planning to remove the legacy code path anyway.
---
A simpler patch as v1 with the same result, as suggested by Peter Ujfalusi.
drivers/mmc/host/omap_hsmmc.c +2 -2
@@ -2159,7 +2159,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev) &rx_req, &pdev->dev, "rx");if (!host->rx_chan) { -dev_err (mmc_dev (host->mmc),"unable to obtain RX DMA engine channel %u\n" , rx_req); +dev_err (mmc_dev (host->mmc),"unable to obtain RX DMA engine channel\n" ); ret = -ENXIO ; goto err_irq; }
@@ -2169,7 +2169,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev) &tx_req, &pdev->dev, "tx");if (!host->tx_chan) { -dev_err (mmc_dev (host->mmc),"unable to obtain TX DMA engine channel %u\n" , tx_req); +dev_err (mmc_dev (host->mmc),"unable to obtain TX DMA engine channel\n" ); ret = -ENXIO ; goto err_irq; }
Quoted 8 lines · Arnd Bergmann
When DT based probing is used but the DMA request fails, the driver will print uninitialized stack data from the
rx_reqandtx_reqvariables, as indicated by this warning:
drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_probe':drivers/mmc/host/omap_hsmmc.c:2162:3: warning: 'rx_req' may be used uninitialized in this function [-Wmaybe-uninitialized]
dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req);
Quoted 7 lines
This removes the DMA request line number from the warning, which is the easiest solution and won't hurt us any more as we are planning to remove the legacy code path anyway.
Signed-off-by Arnd Bergmann <[email protected]>---
A simpler patch as v1 with the same result, as suggested by Peter Ujfalusi.
Looks OK to me:
Quoted 23 lines
drivers/mmc/host/omap_hsmmc.c +2
-2@@ -2159,7 +2159,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev) &rx_req, &pdev->dev, "rx");if (!host->rx_chan) { -dev_err (mmc_dev (host->mmc),"unable to obtain RX DMA engine channel %u\n" , rx_req); +dev_err (mmc_dev (host->mmc),"unable to obtain RX DMA engine channel\n" ); ret = -ENXIO ; goto err_irq; }@@ -2169,7 +2169,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev) &tx_req, &pdev->dev, "tx");if (!host->tx_chan) { -dev_err (mmc_dev (host->mmc),"unable to obtain TX DMA engine channel %u\n" , tx_req); +dev_err (mmc_dev (host->mmc),"unable to obtain TX DMA engine channel\n" ); ret = -ENXIO ; goto err_irq; }
Quoted 8 lines · Arnd Bergmann
When DT based probing is used but the DMA request fails, the driver will print uninitialized stack data from the
rx_reqandtx_reqvariables, as indicated by this warning:
drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_probe':drivers/mmc/host/omap_hsmmc.c:2162:3: warning: 'rx_req' may be used uninitialized in this function [-Wmaybe-uninitialized]
dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req);
Quoted 7 lines
This removes the DMA request line number from the warning, which is the easiest solution and won't hurt us any more as we are planning to remove the legacy code path anyway.
Signed-off-by Arnd Bergmann <[email protected]>---
A simpler patch as v1 with the same result, as suggested by Peter Ujfalusi.
Quoted 24 lines
drivers/mmc/host/omap_hsmmc.c +2
-2@@ -2159,7 +2159,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev) &rx_req, &pdev->dev, "rx");if (!host->rx_chan) { -dev_err (mmc_dev (host->mmc),"unable to obtain RX DMA engine channel %u\n" , rx_req); +dev_err (mmc_dev (host->mmc),"unable to obtain RX DMA engine channel\n" ); ret = -ENXIO ; goto err_irq; }@@ -2169,7 +2169,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev) &tx_req, &pdev->dev, "tx");if (!host->tx_chan) { -dev_err (mmc_dev (host->mmc),"unable to obtain TX DMA engine channel %u\n" , tx_req); +dev_err (mmc_dev (host->mmc),"unable to obtain TX DMA engine channel\n" ); ret = -ENXIO ; goto err_irq; }
Signature · 1 line
P?ter
Ulf Hansson
AppliedQuoted 8 lines · Arnd Bergmann
When DT based probing is used but the DMA request fails, the driver will print uninitialized stack data from the
rx_reqandtx_reqvariables, as indicated by this warning:
drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_probe':drivers/mmc/host/omap_hsmmc.c:2162:3: warning: 'rx_req' may be used uninitialized in this function [-Wmaybe-uninitialized]
dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req);
Quoted 5 lines
This removes the DMA request line number from the warning, which is the easiest solution and won't hurt us any more as we are planning to remove the legacy code path anyway.
Signed-off-by Arnd Bergmann <[email protected]>
Thanks, applied for next!
Kind regards
Uffe
Quoted 26 lines
---
A simpler patch as v1 with the same result, as suggested by Peter Ujfalusi.drivers/mmc/host/omap_hsmmc.c +2
-2@@ -2159,7 +2159,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev) &rx_req, &pdev->dev, "rx");if (!host->rx_chan) { -dev_err (mmc_dev (host->mmc),"unable to obtain RX DMA engine channel %u\n" , rx_req); +dev_err (mmc_dev (host->mmc),"unable to obtain RX DMA engine channel\n" ); ret = -ENXIO ; goto err_irq; }@@ -2169,7 +2169,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev) &tx_req, &pdev->dev, "tx");if (!host->tx_chan) { -dev_err (mmc_dev (host->mmc),"unable to obtain TX DMA engine channel %u\n" , tx_req); +dev_err (mmc_dev (host->mmc),"unable to obtain TX DMA engine channel\n" ); ret = -ENXIO ; goto err_irq; }