util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francesco Cosoleto <cosoleto@gmail.com>
To: util-linux@vger.kernel.org
Cc: Francesco Cosoleto <cosoleto@gmail.com>
Subject: [PATCH 1/2] lib: [loopdev.c] fix use of logical '&&' with constant operand
Date: Thu, 15 Sep 2011 16:17:45 +0200	[thread overview]
Message-ID: <1316096266-14692-1-git-send-email-cosoleto@gmail.com> (raw)

Found by clang.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
---
 lib/loopdev.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/loopdev.c b/lib/loopdev.c
index 81b7d2d..7c095ee 100644
--- a/lib/loopdev.c
+++ b/lib/loopdev.c
@@ -116,7 +116,7 @@ int loopcxt_init(struct loopdev_cxt *lc, int flags)
 	lc->flags = flags;
 	loopcxt_set_device(lc, NULL);
 
-	if (!(lc->flags && LOOPDEV_FL_NOSYSFS) &&
+	if (!(lc->flags & LOOPDEV_FL_NOSYSFS) &&
 	    get_linux_version() >= KERNEL_VERSION(2,6,37))
 		/*
 		 * Use only sysfs for basic information about loop devices
@@ -244,7 +244,7 @@ int loopcxt_init_iterator(struct loopdev_cxt *lc, int flags)
 		/*
 		 * Check for /dev/loop/<N> subdirectory
 		 */
-		if (!(lc->flags && LOOPDEV_FL_DEVSUBDIR) &&
+		if (!(lc->flags & LOOPDEV_FL_DEVSUBDIR) &&
 		    stat(_PATH_DEV_LOOP, &st) == 0 && S_ISDIR(st.st_mode))
 			lc->flags |= LOOPDEV_FL_DEVSUBDIR;
 
-- 
1.7.3.4


             reply	other threads:[~2011-09-15 14:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-15 14:17 Francesco Cosoleto [this message]
2011-09-15 14:17 ` [PATCH 2/2] libmount: fix use of logical '&&' with constant operand Francesco Cosoleto
2011-09-27 13:07   ` Karel Zak
2011-09-27 13:07 ` [PATCH 1/2] lib: [loopdev.c] " Karel Zak

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=1316096266-14692-1-git-send-email-cosoleto@gmail.com \
    --to=cosoleto@gmail.com \
    --cc=util-linux@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).