Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3077136pxu; Mon, 19 Oct 2020 03:24:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6Rqw79nioNEajJT25CEQ0+/pQ4T6sOsO2yS6J2uoqTx+DlWUm158ab0QCyvFceumGhX1j X-Received: by 2002:a50:88c6:: with SMTP id d64mr17640300edd.141.1603103049208; Mon, 19 Oct 2020 03:24:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603103049; cv=none; d=google.com; s=arc-20160816; b=d/0qvg4qLXrR5HX3OnJcf02AfwRp7i5PMCiOmSPxa5yJdevzCFy/bTYmCqj1zN9nlH mtlEhvWcrrhJRCgiLBKmZYFfrLuc2OtayDTGE/USq6rHk/uaAqSi3fa6A300UnyM7yde k1EpDVnpU9bFy1xX329AAn62inpC6MW8Ub3eJhwJ8YLvoYYlusKGvDYE0kPV9lf9AAhU EOxyZvVsJTEtYSFkW8BW36wrVtKgUueo94SpnLCNvLQa/pQ4w/J31dumR4UYnE8YgLAX w5Yby2vWvot1+0FgFkhXrOPH0C3u7n9uROnw3pRYHE8ORmWCE5aobHZ850eM9iz5ngL0 yvww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=nht5IEUnWRDIa3wd7j29J5HrQ+eDsGSz/Uz7KRhuRR0=; b=cxIfdfDv1dh3Xc1nSxNqvT0WSsdWbBjOTNtjNEQj8XZl2TqgfwYCBHnW4+mhIhDtap 2fWZG3Y4LdLb+4NHHRXmayr2l8QLjS0TPeIDs5cvD6G6gT9JtLxM2i30oHMn8nnr8VXr mjbRS0v5/zyTHOqbGgIkXzi0iT6cZIj9F3vtZsSj/OspWIQZMSkiRfX6iLAveLiBFulQ nQzaVJz7rWjfnXC8HaokXDoRNJ1eIMqM449jLPGd//BGkDI2C1Vzf/yv32z4M8GHbdRR kT11JOlxJz/K+M3Gs14SUlgHK6A0J3qq4UDQsiUBwaq2YCT7zdQn5VKkeKFGrqrDH3GE B2ZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i10si7464345ejz.433.2020.10.19.03.23.46; Mon, 19 Oct 2020 03:24:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727150AbgJSGy1 (ORCPT + 99 others); Mon, 19 Oct 2020 02:54:27 -0400 Received: from smtp.h3c.com ([60.191.123.50]:42874 "EHLO h3cspam02-ex.h3c.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726985AbgJSGy1 (ORCPT ); Mon, 19 Oct 2020 02:54:27 -0400 Received: from DAG2EX03-BASE.srv.huawei-3com.com ([10.8.0.66]) by h3cspam02-ex.h3c.com with ESMTPS id 09J6rqpA087016 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 19 Oct 2020 14:53:52 +0800 (GMT-8) (envelope-from tian.xianting@h3c.com) Received: from localhost.localdomain (10.99.212.201) by DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 19 Oct 2020 14:53:54 +0800 From: Xianting Tian To: , CC: , , Xianting Tian Subject: [PATCH] gfs2: use helper macro abs() Date: Mon, 19 Oct 2020 14:43:49 +0800 Message-ID: <20201019064349.48828-1-tian.xianting@h3c.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.99.212.201] X-ClientProxiedBy: BJSMTP02-EX.srv.huawei-3com.com (10.63.20.133) To DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) X-DNSRBL: X-MAIL: h3cspam02-ex.h3c.com 09J6rqpA087016 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use helper macro abs() to simplify the "x >= y || x <= -y" cmp. Signed-off-by: Xianting Tian --- fs/gfs2/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 9f4d9e7be..05eb709de 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -304,7 +304,7 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free, if (sdp->sd_args.ar_statfs_percent) { x = 100 * l_sc->sc_free; y = m_sc->sc_free * sdp->sd_args.ar_statfs_percent; - if (x >= y || x <= -y) + if (abs(x) >= y) need_sync = 1; } spin_unlock(&sdp->sd_statfs_spin); -- 2.17.1