linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] hwrng: Fix W=1 warnings
@ 2020-06-29  8:03 Herbert Xu
  2020-06-29  8:03 ` [PATCH 1/7] hwrng: npcm - Fix W=1 unused variable warning Herbert Xu
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Herbert Xu @ 2020-06-29  8:03 UTC (permalink / raw)
  To: Linux Crypto Mailing List

This patch series fixes a bunch of warnings encountered with W=1.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* [PATCH 1/7] hwrng: npcm - Fix W=1 unused variable warning
  2020-06-29  8:03 [PATCH 0/7] hwrng: Fix W=1 warnings Herbert Xu
@ 2020-06-29  8:03 ` Herbert Xu
  2020-06-29  8:03 ` [PATCH 2/7] hwrng: omap " Herbert Xu
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2020-06-29  8:03 UTC (permalink / raw)
  To: Linux Crypto Mailing List

This patch fixes an unused variable warning when this driver is
built-in with CONFIG_OF=n.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---

 drivers/char/hw_random/npcm-rng.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/npcm-rng.c b/drivers/char/hw_random/npcm-rng.c
index 01d04404d8c04..5d0d13f891b70 100644
--- a/drivers/char/hw_random/npcm-rng.c
+++ b/drivers/char/hw_random/npcm-rng.c
@@ -161,7 +161,7 @@ static const struct dev_pm_ops npcm_rng_pm_ops = {
 				pm_runtime_force_resume)
 };
 
-static const struct of_device_id rng_dt_id[] = {
+static const struct of_device_id rng_dt_id[] __maybe_unused = {
 	{ .compatible = "nuvoton,npcm750-rng",  },
 	{},
 };

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

* [PATCH 2/7] hwrng: omap - Fix W=1 unused variable warning
  2020-06-29  8:03 [PATCH 0/7] hwrng: Fix W=1 warnings Herbert Xu
  2020-06-29  8:03 ` [PATCH 1/7] hwrng: npcm - Fix W=1 unused variable warning Herbert Xu
@ 2020-06-29  8:03 ` Herbert Xu
  2020-06-29  8:03 ` [PATCH 3/7] hwrng: hisi " Herbert Xu
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2020-06-29  8:03 UTC (permalink / raw)
  To: Linux Crypto Mailing List

This patch fixes an unused variable warning when this driver is
built-in with CONFIG_OF=n.  While we're at it this patch also
expands the compiler coverage when CONFIG_OF is off by removing
all the CONFIG_OF ifdefs.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---

 drivers/char/hw_random/omap-rng.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index 7290c603fcb8e..5cc5fc5049682 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -22,6 +22,7 @@
 #include <linux/platform_device.h>
 #include <linux/hw_random.h>
 #include <linux/delay.h>
+#include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
@@ -243,7 +244,6 @@ static struct omap_rng_pdata omap2_rng_pdata = {
 	.cleanup	= omap2_rng_cleanup,
 };
 
-#if defined(CONFIG_OF)
 static inline u32 omap4_rng_data_present(struct omap_rng_dev *priv)
 {
 	return omap_rng_read(priv, RNG_STATUS_REG) & RNG_REG_STATUS_RDY;
@@ -358,7 +358,7 @@ static struct omap_rng_pdata eip76_rng_pdata = {
 	.cleanup	= omap4_rng_cleanup,
 };
 
-static const struct of_device_id omap_rng_of_match[] = {
+static const struct of_device_id omap_rng_of_match[] __maybe_unused = {
 		{
 			.compatible	= "ti,omap2-rng",
 			.data		= &omap2_rng_pdata,
@@ -418,13 +418,6 @@ static int of_get_omap_rng_device_details(struct omap_rng_dev *priv,
 	}
 	return 0;
 }
-#else
-static int of_get_omap_rng_device_details(struct omap_rng_dev *omap_rng,
-					  struct platform_device *pdev)
-{
-	return -EINVAL;
-}
-#endif
 
 static int get_omap_rng_device_details(struct omap_rng_dev *omap_rng)
 {

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

* [PATCH 3/7] hwrng: hisi - Fix W=1 unused variable warning
  2020-06-29  8:03 [PATCH 0/7] hwrng: Fix W=1 warnings Herbert Xu
  2020-06-29  8:03 ` [PATCH 1/7] hwrng: npcm - Fix W=1 unused variable warning Herbert Xu
  2020-06-29  8:03 ` [PATCH 2/7] hwrng: omap " Herbert Xu
@ 2020-06-29  8:03 ` Herbert Xu
  2020-06-29  8:04 ` [PATCH 4/7] hwrng: bcm2835 " Herbert Xu
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2020-06-29  8:03 UTC (permalink / raw)
  To: Linux Crypto Mailing List

This patch fixes an unused variable warning when this driver is
built-in with CONFIG_OF=n.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---

 drivers/char/hw_random/hisi-rng.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/hisi-rng.c b/drivers/char/hw_random/hisi-rng.c
index 6815e17a9834c..96438f85cafa7 100644
--- a/drivers/char/hw_random/hisi-rng.c
+++ b/drivers/char/hw_random/hisi-rng.c
@@ -99,7 +99,7 @@ static int hisi_rng_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id hisi_rng_dt_ids[] = {
+static const struct of_device_id hisi_rng_dt_ids[] __maybe_unused = {
 	{ .compatible = "hisilicon,hip04-rng" },
 	{ .compatible = "hisilicon,hip05-rng" },
 	{ }

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

* [PATCH 4/7] hwrng: bcm2835 - Fix W=1 unused variable warning
  2020-06-29  8:03 [PATCH 0/7] hwrng: Fix W=1 warnings Herbert Xu
                   ` (2 preceding siblings ...)
  2020-06-29  8:03 ` [PATCH 3/7] hwrng: hisi " Herbert Xu
@ 2020-06-29  8:04 ` Herbert Xu
  2020-06-29  8:04 ` [PATCH 5/7] hwrng: st " Herbert Xu
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2020-06-29  8:04 UTC (permalink / raw)
  To: Linux Crypto Mailing List

This patch fixes an unused variable warning when this driver is
built with CONFIG_OF=n.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---

 drivers/char/hw_random/bcm2835-rng.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c
index cbf5eaea662c5..eec26329d1ea7 100644
--- a/drivers/char/hw_random/bcm2835-rng.c
+++ b/drivers/char/hw_random/bcm2835-rng.c
@@ -139,7 +139,6 @@ static int bcm2835_rng_probe(struct platform_device *pdev)
 {
 	const struct bcm2835_rng_of_data *of_data;
 	struct device *dev = &pdev->dev;
-	struct device_node *np = dev->of_node;
 	const struct of_device_id *rng_id;
 	struct bcm2835_rng_priv *priv;
 	int err;
@@ -166,7 +165,7 @@ static int bcm2835_rng_probe(struct platform_device *pdev)
 	priv->rng.cleanup = bcm2835_rng_cleanup;
 
 	if (dev_of_node(dev)) {
-		rng_id = of_match_node(bcm2835_rng_of_match, np);
+		rng_id = of_match_node(bcm2835_rng_of_match, dev->of_node);
 		if (!rng_id)
 			return -EINVAL;
 

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

* [PATCH 5/7] hwrng: st - Fix W=1 unused variable warning
  2020-06-29  8:03 [PATCH 0/7] hwrng: Fix W=1 warnings Herbert Xu
                   ` (3 preceding siblings ...)
  2020-06-29  8:04 ` [PATCH 4/7] hwrng: bcm2835 " Herbert Xu
@ 2020-06-29  8:04 ` Herbert Xu
  2020-06-29  8:04 ` [PATCH 6/7] hwrng: pic32 " Herbert Xu
  2020-06-29  8:04 ` [PATCH 7/7] hwrng: octeon - Fix sparse warnings Herbert Xu
  6 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2020-06-29  8:04 UTC (permalink / raw)
  To: Linux Crypto Mailing List

This patch fixes an unused variable warning when this driver is
built-in with CONFIG_OF=n.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---

 drivers/char/hw_random/st-rng.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/st-rng.c b/drivers/char/hw_random/st-rng.c
index 783c24e3f8b7f..15ba1e6fae4d2 100644
--- a/drivers/char/hw_random/st-rng.c
+++ b/drivers/char/hw_random/st-rng.c
@@ -12,6 +12,7 @@
 #include <linux/delay.h>
 #include <linux/hw_random.h>
 #include <linux/io.h>
+#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
@@ -121,7 +122,7 @@ static int st_rng_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id st_rng_match[] = {
+static const struct of_device_id st_rng_match[] __maybe_unused = {
 	{ .compatible = "st,rng" },
 	{},
 };

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

* [PATCH 6/7] hwrng: pic32 - Fix W=1 unused variable warning
  2020-06-29  8:03 [PATCH 0/7] hwrng: Fix W=1 warnings Herbert Xu
                   ` (4 preceding siblings ...)
  2020-06-29  8:04 ` [PATCH 5/7] hwrng: st " Herbert Xu
@ 2020-06-29  8:04 ` Herbert Xu
  2020-06-29  8:04 ` [PATCH 7/7] hwrng: octeon - Fix sparse warnings Herbert Xu
  6 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2020-06-29  8:04 UTC (permalink / raw)
  To: Linux Crypto Mailing List

This patch fixes an unused variable warning when this driver is
built-in with CONFIG_OF=n.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---

 drivers/char/hw_random/pic32-rng.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/pic32-rng.c b/drivers/char/hw_random/pic32-rng.c
index 81080cb2294e7..e8210c1715cfd 100644
--- a/drivers/char/hw_random/pic32-rng.c
+++ b/drivers/char/hw_random/pic32-rng.c
@@ -119,7 +119,7 @@ static int pic32_rng_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id pic32_rng_of_match[] = {
+static const struct of_device_id pic32_rng_of_match[] __maybe_unused = {
 	{ .compatible	= "microchip,pic32mzda-rng", },
 	{ /* sentinel */ }
 };

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

* [PATCH 7/7] hwrng: octeon - Fix sparse warnings
  2020-06-29  8:03 [PATCH 0/7] hwrng: Fix W=1 warnings Herbert Xu
                   ` (5 preceding siblings ...)
  2020-06-29  8:04 ` [PATCH 6/7] hwrng: pic32 " Herbert Xu
@ 2020-06-29  8:04 ` Herbert Xu
  6 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2020-06-29  8:04 UTC (permalink / raw)
  To: Linux Crypto Mailing List

This patch fixes a bunch of sparse warnings by adding __force tags
when casting __iomem poitners to u64.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---

 drivers/char/hw_random/octeon-rng.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/char/hw_random/octeon-rng.c b/drivers/char/hw_random/octeon-rng.c
index 7be8067ac4e87..8561a09b46814 100644
--- a/drivers/char/hw_random/octeon-rng.c
+++ b/drivers/char/hw_random/octeon-rng.c
@@ -33,7 +33,7 @@ static int octeon_rng_init(struct hwrng *rng)
 	ctl.u64 = 0;
 	ctl.s.ent_en = 1; /* Enable the entropy source.  */
 	ctl.s.rng_en = 1; /* Enable the RNG hardware.  */
-	cvmx_write_csr((u64)p->control_status, ctl.u64);
+	cvmx_write_csr((__force u64)p->control_status, ctl.u64);
 	return 0;
 }
 
@@ -44,14 +44,14 @@ static void octeon_rng_cleanup(struct hwrng *rng)
 
 	ctl.u64 = 0;
 	/* Disable everything.  */
-	cvmx_write_csr((u64)p->control_status, ctl.u64);
+	cvmx_write_csr((__force u64)p->control_status, ctl.u64);
 }
 
 static int octeon_rng_data_read(struct hwrng *rng, u32 *data)
 {
 	struct octeon_rng *p = container_of(rng, struct octeon_rng, ops);
 
-	*data = cvmx_read64_uint32((u64)p->result);
+	*data = cvmx_read64_uint32((__force u64)p->result);
 	return sizeof(u32);
 }
 

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

end of thread, other threads:[~2020-06-29 19:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29  8:03 [PATCH 0/7] hwrng: Fix W=1 warnings Herbert Xu
2020-06-29  8:03 ` [PATCH 1/7] hwrng: npcm - Fix W=1 unused variable warning Herbert Xu
2020-06-29  8:03 ` [PATCH 2/7] hwrng: omap " Herbert Xu
2020-06-29  8:03 ` [PATCH 3/7] hwrng: hisi " Herbert Xu
2020-06-29  8:04 ` [PATCH 4/7] hwrng: bcm2835 " Herbert Xu
2020-06-29  8:04 ` [PATCH 5/7] hwrng: st " Herbert Xu
2020-06-29  8:04 ` [PATCH 6/7] hwrng: pic32 " Herbert Xu
2020-06-29  8:04 ` [PATCH 7/7] hwrng: octeon - Fix sparse warnings Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).