Skip to contentSkip to conversation

soc: sifive: l2 cache: Eliminate an unsigned zero compare warning

PATCH New Palmer Dabbelt 1 participant 2 messages May 28, 2020

Subsystems (2)
lore
Share & tools
lore

Palmer Dabbelt

author maintainer
#0 lore raw

PATCH 1/2 soc: sifive: l2 cache: Eliminate an unsigned zero compare warning

From: Palmer Dabbelt <[email protected]>

GCC warns about this comparison, which is unnecessary.

---
 drivers/soc/sifive/sifive_l2_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/sifive/sifive_l2_cache.c +1 -1
index d5f266551880..51e198880a8d 100644
@@ -51,7 +51,7 @@ static ssize_t l2_write(struct file *file, const char __user *data,
 
 	if (kstrtouint_from_user(data, count, 0, &val))
 		return -EINVAL;
-	if ((val >= 0 && val < 0xFF) || (val >= 0x10000 && val < 0x100FF))
+	if ((val < 0xFF) || (val >= 0x10000 && val < 0x100FF))
 		writel(val, l2_base + SIFIVE_L2_ECCINJECTERR);
 	else
 		return -EINVAL;
Signature · 1 line
2.27.0.rc0.183.gde8f92d652-goog
author maintainer
#1 lore raw

PATCH 2/2 soc: sifive: l2 cache: Mark l2_get_priv_group as static

From: Palmer Dabbelt <[email protected]>

The kbuild test robot is firing a warning over a missing prototype. The function can just be static.

---
 drivers/soc/sifive/sifive_l2_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/sifive/sifive_l2_cache.c +1 -1
index 51e198880a8d..44d7e1951da3 100644
@@ -133,7 +133,7 @@ static const struct attribute_group priv_attr_group = {
 	.attrs = priv_attrs,
 };
 
-const struct attribute_group *l2_get_priv_group(struct cacheinfo *this_leaf)
+static const struct attribute_group *l2_get_priv_group(struct cacheinfo *this_leaf)
 {
 	/* We want to use private group for L2 cache only */
 	if (this_leaf->level == 2)
Signature · 1 line
2.27.0.rc0.183.gde8f92d652-goog