linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-fsdevel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 07/10] staging: exfat: Clean up return codes - FFS_SUCCESS
Date: Mon, 04 Nov 2019 05:53:55 -0500	[thread overview]
Message-ID: <128761.1572864835@turing-police> (raw)
In-Reply-To: <20191104100413.GC10409@kadam>

[-- Attachment #1: Type: text/plain, Size: 773 bytes --]

On Mon, 04 Nov 2019 13:04:14 +0300, Dan Carpenter said:
> On Sun, Nov 03, 2019 at 08:45:03PM -0500, Valdis Kletnieks wrote:
> > -	if (sector_read(sb, sec, &bp->buf_bh, 1) != FFS_SUCCESS) {
> > +	if (sector_read(sb, sec, &bp->buf_bh, 1) != 0) {
>
> It's better to just remove the "!= 0" double negative.  != 0 should be
> used when we are talking about the number zero as in "cnt != 0" and for
> "strcmp(foo, bar) != 0" where it means that "foo != bar".

"Fix up ==0 and !=0" is indeed on the to-do list.

This patch converted 82 uses of FFS_SUCCESS, of which 33 had the != idiom in
use.  Meanwhile, overall there's 53 '!= 0' and 95 '== 0' uses.

In other words, even if I fixed all of those that were involved in this patch,
there would *still* be more patching to do.





[-- Attachment #2: Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2019-11-04 10:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04  1:44 [PATCH v2 00/10] staging: exfat: Clean up return codes, revisited Valdis Kletnieks
2019-11-04  1:44 ` [PATCH v2 01/10] staging: exfat: Clean up return codes - FFS_FORMATERR Valdis Kletnieks
2019-11-05 17:05   ` Greg Kroah-Hartman
2019-11-05 22:20     ` Valdis Klētnieks
2019-11-04  1:44 ` [PATCH v2 02/10] staging: exfat: Clean up return codes - FFS_MEDIAERR Valdis Kletnieks
2019-11-04  1:44 ` [PATCH v2 03/10] staging: exfat: Clean up return codes - FFS_EOF Valdis Kletnieks
2019-11-04  1:45 ` [PATCH v2 04/10] staging: exfat: Clean up return codes - FFS_INVALIDFID Valdis Kletnieks
2019-11-04  1:45 ` [PATCH v2 05/10] staging: exfat: Clean up return codes - FFS_ERROR Valdis Kletnieks
2019-11-04  1:45 ` [PATCH v2 06/10] staging: exfat: Clean up return codes - remove unused codes Valdis Kletnieks
2019-11-04  1:45 ` [PATCH v2 07/10] staging: exfat: Clean up return codes - FFS_SUCCESS Valdis Kletnieks
2019-11-04 10:04   ` Dan Carpenter
2019-11-04 10:53     ` Valdis Klētnieks [this message]
2019-11-04 10:56       ` Dan Carpenter
2019-11-04  1:45 ` [PATCH v2 08/10] staging: exfat: Collapse redundant return code translations Valdis Kletnieks
2019-11-04  1:45 ` [PATCH v2 09/10] staging: exfat: Correct return code Valdis Kletnieks
2019-11-04  1:45 ` [PATCH 10/10] errno.h: Provide EFSCORRUPTED for everybody Valdis Kletnieks
2019-11-04  2:09   ` Gao Xiang
2019-11-05  0:33   ` Christoph Hellwig
2019-11-05  0:54     ` Valdis Klētnieks
2019-11-05  3:43   ` Chao Yu
2019-11-06 21:37     ` Pavel Machek
2019-11-05 16:59 ` [PATCH v2 00/10] staging: exfat: Clean up return codes, revisited Greg Kroah-Hartman

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=128761.1572864835@turing-police \
    --to=valdis.kletnieks@vt.edu \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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).