public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Ian Cowan <ian@linux.cowan.aero>
To: Sven Van Asbroeck <TheSven73@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Ian Cowan <ian@linux.cowan.aero>
Subject: [PATCH] staging: fieldbus: remove unnecessary double negation
Date: Mon, 25 Apr 2022 10:54:40 -0400	[thread overview]
Message-ID: <20220425145440.146891-1-ian@linux.cowan.aero> (raw)

Remove the double negation (!!) from the code since this does nothing
and may create confusion on whether or not those values are negated.

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


             reply	other threads:[~2022-04-25 14:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25 14:54 Ian Cowan [this message]
2022-04-25 15:47 ` [PATCH] staging: fieldbus: remove unnecessary double negation Greg Kroah-Hartman
2022-04-25 22:26   ` Ian Cowan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220425145440.146891-1-ian@linux.cowan.aero \
    --to=ian@linux.cowan.aero \
    --cc=TheSven73@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox