Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp666455ybv; Thu, 13 Feb 2020 07:26:49 -0800 (PST) X-Google-Smtp-Source: APXvYqx7F/oAQMbq81rCTBePCtIZlo+5LnNk1syNSku003Tm16S3bZXn0tT5T1C4t6rUytz90ojd X-Received: by 2002:aca:190b:: with SMTP id l11mr3364050oii.65.1581607609430; Thu, 13 Feb 2020 07:26:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581607609; cv=none; d=google.com; s=arc-20160816; b=ivpTuKu8ceYt9PTUGFS8A2WhZoOKtX2ArvP0oSlDevj7MSVVEDS2UBKdSoUuEO4L/J lVVMr7DGDnp1qnXhhED7bx9lD2mZOmWmDfVIZLPBJqloHMP5eXVgqJVOL1Oidd89GhpP WOkd5jwXGZhu27Yy4ApchZc0gbR28mlCOeBVW0SkT/qZyhChzPaQu3RKVwNolwdKYT4z 3tizAfMhr4xWpNJBuEpYVdyWyMg7T4EDkvypblGOCg1FD2hzBHs8u8fCShXlz98J7ybj fEsLB5CJRT2YQen8NHQUTIg6L8eFGh7lN5E1XFuk6OmX8RgDPRcHHPp6eiGQDRxjNfR8 Ay5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WPxWVTkfgaO6S98Onni4TD1vd+gx8EElF9pN9pIJHpU=; b=oTwaN9+uR3y1UxaNxRM6KFW0yb3YapDTAGDQ/bAZBqFuci+leUa5kAEGRNVuwVk+LD OCDmep5e78P5TZ8TQ/OT6zZaDFbDaEjpw12lCUr7dylUxta8GfVo8kMUkWJhKtjJnrqa hXztrYfEiF8qI8x02F9Fmo/pXH57/dH+CTsQRa35NLaaY2cOkgbEgGuwLtO/nZ8nmDNe kn9np0HNh37B47hPXM/XSOpCqZecW/VFXrqoCRFOMVQhN3PZ8fAOyWB4vQNtDRIGVR/U 78KvAdCI7TFjC1ilsIkUl0vh7vGxlScO0Ru5TCD93A0GI+AWVLhwSVXhGn1CxA6WPlp6 FS6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KlVuJeG+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si1240461otk.77.2020.02.13.07.26.37; Thu, 13 Feb 2020 07:26:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KlVuJeG+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729121AbgBMPZz (ORCPT + 99 others); Thu, 13 Feb 2020 10:25:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:37070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728624AbgBMPYM (ORCPT ); Thu, 13 Feb 2020 10:24:12 -0500 Received: from localhost (unknown [104.132.1.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 270AC246B8; Thu, 13 Feb 2020 15:24:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607451; bh=yRnA6JdzSxs+BXzyZy2xTQIqsLKnilJe/TavlJFPZ/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KlVuJeG+RsefnrF9AeHYRDBiaOvTIYtUH8jgNP5e/gSSHEP12itGthqToxcKpPyhc FohIW9UyEiraXMGIqk3fAqA/jWHKEIWM3wyGjBAteJoZG500nyisT25n4cJZu3JK/B mf88udR6/wGrRNVlCRh4HXaYKfY8Pi1iL//kJ1tM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Meyer , Anna Schumaker , Sasha Levin Subject: [PATCH 4.9 078/116] NFS: Fix bool initialization/comparison Date: Thu, 13 Feb 2020 07:20:22 -0800 Message-Id: <20200213151913.139663516@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151842.259660170@linuxfoundation.org> References: <20200213151842.259660170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Meyer [ Upstream commit 6089dd0d731028531fb1148be9fd33274ff90da4 ] Bool initializations should use true and false. Bool tests don't need comparisons. Signed-off-by: Thomas Meyer Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- fs/nfs/callback_proc.c | 2 +- fs/nfs/dir.c | 10 +++++----- fs/nfs/nfs4client.c | 2 +- fs/nfs/pnfs.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index 9d7537446260b..0d4a56c77a1a9 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c @@ -419,7 +419,7 @@ static bool referring_call_exists(struct nfs_client *clp, uint32_t nrclists, struct referring_call_list *rclists) { - bool status = 0; + bool status = false; int i, j; struct nfs4_session *session; struct nfs4_slot_table *tbl; diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 5936c54ac5fdb..2c6e64dce2bdb 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -289,7 +289,7 @@ int nfs_readdir_search_for_pos(struct nfs_cache_array *array, nfs_readdir_descri desc->cache_entry_index = index; return 0; out_eof: - desc->eof = 1; + desc->eof = true; return -EBADCOOKIE; } @@ -343,7 +343,7 @@ int nfs_readdir_search_for_cookie(struct nfs_cache_array *array, nfs_readdir_des if (array->eof_index >= 0) { status = -EBADCOOKIE; if (*desc->dir_cookie == array->last_cookie) - desc->eof = 1; + desc->eof = true; } out: return status; @@ -812,7 +812,7 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc) ent = &array->array[i]; if (!dir_emit(desc->ctx, ent->string.name, ent->string.len, nfs_compat_user_ino64(ent->ino), ent->d_type)) { - desc->eof = 1; + desc->eof = true; break; } desc->ctx->pos++; @@ -824,7 +824,7 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc) ctx->duped = 1; } if (array->eof_index >= 0) - desc->eof = 1; + desc->eof = true; nfs_readdir_release_array(desc->page); out: @@ -925,7 +925,7 @@ static int nfs_readdir(struct file *file, struct dir_context *ctx) if (res == -EBADCOOKIE) { res = 0; /* This means either end of directory */ - if (*desc->dir_cookie && desc->eof == 0) { + if (*desc->dir_cookie && !desc->eof) { /* Or that the server has 'lost' a cookie */ res = uncached_readdir(desc); if (res == 0) diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index 1ec6dd4f3e2e4..3ee60c5332179 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c @@ -847,7 +847,7 @@ nfs4_find_client_sessionid(struct net *net, const struct sockaddr *addr, spin_lock(&nn->nfs_client_lock); list_for_each_entry(clp, &nn->nfs_client_list, cl_share_link) { - if (nfs4_cb_match_client(addr, clp, minorversion) == false) + if (!nfs4_cb_match_client(addr, clp, minorversion)) continue; if (!nfs4_has_session(clp)) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 0e008db16b169..c3abf92adfb7d 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1436,7 +1436,7 @@ pnfs_lseg_range_match(const struct pnfs_layout_range *ls_range, if ((range->iomode == IOMODE_RW && ls_range->iomode != IOMODE_RW) || (range->iomode != ls_range->iomode && - strict_iomode == true) || + strict_iomode) || !pnfs_lseg_range_intersecting(ls_range, range)) return 0; -- 2.20.1