The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2] staging: fieldbus: remove unnecessary double negation
@ 2022-04-25 22:25 Ian Cowan
  2022-04-26  5:29 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Cowan @ 2022-04-25 22:25 UTC (permalink / raw)
  To: Sven Van Asbroeck
  Cc: Greg Kroah-Hartman, linux-staging, linux-kernel, Ian Cowan

The values that are being double negated in this case are booleans to begin
with, so the double negation has no effect on the result.

Signed-off-by: Ian Cowan <ian@linux.cowan.aero>
---
 drivers/staging/fieldbus/dev_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fieldbus/dev_core.c b/drivers/staging/fieldbus/dev_core.c
index 5aab734606ea..6766b2b13482 100644
--- a/drivers/staging/fieldbus/dev_core.c
+++ b/drivers/staging/fieldbus/dev_core.c
@@ -28,7 +28,7 @@ static ssize_t online_show(struct device *dev, struct device_attribute *attr,
 {
 	struct fieldbus_dev *fb = dev_get_drvdata(dev);
 
-	return sprintf(buf, "%d\n", !!fb->online);
+	return sprintf(buf, "%d\n", fb->online);
 }
 static DEVICE_ATTR_RO(online);
 
@@ -39,7 +39,7 @@ static ssize_t enabled_show(struct device *dev, struct device_attribute *attr,
 
 	if (!fb->enable_get)
 		return -EINVAL;
-	return sprintf(buf, "%d\n", !!fb->enable_get(fb));
+	return sprintf(buf, "%d\n", fb->enable_get(fb));
 }
 
 static ssize_t enabled_store(struct device *dev, struct device_attribute *attr,
-- 
2.35.1


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

end of thread, other threads:[~2022-04-26  5:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-25 22:25 [PATCH v2] staging: fieldbus: remove unnecessary double negation Ian Cowan
2022-04-26  5:29 ` Greg Kroah-Hartman

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