Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp937546ybi; Wed, 3 Jul 2019 06:56:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUMQFYmBv55POw8sIXfi3q0/jhEp/wmTnuQegsN3z+OEb4/pN31AAbjz2STTUv8TwkVZak X-Received: by 2002:a63:2cd1:: with SMTP id s200mr37582222pgs.439.1562162175749; Wed, 03 Jul 2019 06:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562162175; cv=none; d=google.com; s=arc-20160816; b=PPC+yNwcDgcsyrtHdEbrYYbzGtvRzS2nwkXZ38VetsJG1e4PbuIsXTw8Ih6UOBCL6c 5kZq//6IgEPcCnDaOCR8C7PmiQu5NKgVxJqJ5V9ivFFX/TAVIuhibu0WqWKQ9hom/1PT GeEH2UDau0WMZ14uBv3B++6zCh32yEo74gp1WayaWooXeEwVf+H+dNueGK8sLzj6WfAC uMrDrKLnsTWEwfsQE6JNyJAWTU7QTt4EBIP2BuT4L57yLjp60BexBQDGPoJFk3MoTP+a hSj13Q3jg2r+AIeSXNtLLWkXHO66X1/VSKoz4QcwyaKXlY9pn891lwiEClMCEj4nq8X6 EuFQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:to:subject; bh=HcLFYktpv67BtLBE/X6rGlPVcxAJtzLSCfl4TMVKP44=; b=flXKnFi3UbhppTb5XxEV6TE8E+00zfIzrQcze6ATfRPX+zGcl+74se4EfXwQdOjdZi XpKBl1dirLYa3RlZb4GGC8BP0pLHiMIEPVZiT/zTT5HsbtaF8u2ZK9+rwqjk7rO1NhkM zHNtP1bgU6D05MqcEVCuv0Xafquh2HYq3WMdBWjRQCba3DeHN8XHjZEqIxlYWbarggeo TVtSr1G/1eBnwSGfKQML4ff4vm4oWuv3HC0OwT2xmNqVZLEjDC566Hmr+1NqzvjzAeqJ g6kPowihWUskbZAtoTPhWAYtigMHW3Zs/ko+z2p16yGgiBv5MbqqsSmLg3JXY5VJUQ71 8QXA== ARC-Authentication-Results: i=1; mx.google.com; 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 t13si2268032pgu.142.2019.07.03.06.56.00; Wed, 03 Jul 2019 06:56:15 -0700 (PDT) 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; 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 S1726823AbfGCNzi (ORCPT + 99 others); Wed, 3 Jul 2019 09:55:38 -0400 Received: from sandeen.net ([63.231.237.45]:52240 "EHLO sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbfGCNzi (ORCPT ); Wed, 3 Jul 2019 09:55:38 -0400 Received: from [10.0.0.4] (liberator [10.0.0.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id A01224507BF; Wed, 3 Jul 2019 08:55:14 -0500 (CDT) Subject: Re: [PATCH] fs: xfs: xfs_log: Change return type from int to void To: Hariprasad Kelam , "Darrick J. Wong" , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190702181547.GA11316@hari-Inspiron-1545> From: Eric Sandeen Openpgp: preference=signencrypt Autocrypt: addr=sandeen@sandeen.net; prefer-encrypt=mutual; keydata= mQINBE6x99QBEADMR+yNFBc1Y5avoUhzI/sdR9ANwznsNpiCtZlaO4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7iCs5tFs2OrMqV5juSMGmn0kxJUAEQEAAYkCHwQY AQIACQUCTrH31AIbDAAKCRAgrhaS4T3e4BKwD/0ZOOmUNOZCSOLAMjZx3mtYtjYgfUNKi0ki YPveGoRWTqbis8UitPtNrG4XxgzLOijSdOEzQwkdOIp/QnZhGNssMejCnsluK0GQd+RkFVWN mcQT78hBeGcnEMAXZKq7bkIKzvc06GFmkMbX/gAl6DiNGv0UNAX+5FYh+ucCJZSyAp3sA+9/ LKjxnTedX0aygXA6rkpX0Y0FvN/9dfm47+LGq7WAqBOyYTU3E6/+Z72bZoG/cG7ANLxcPool LOrU43oqFnD8QwcN56y4VfFj3/jDF2MX3xu4v2OjglVjMEYHTCxP3mpxesGHuqOit/FR+mF0 MP9JGfj6x+bj/9JMBtCW1bY/aPeMdPGTJvXjGtOVYblGZrSjXRn5++Uuy36CvkcrjuziSDG+ JEexGxczWwN4mrOQWhMT5Jyb+18CO+CWxJfHaYXiLEW7dI1AynL4jjn4W0MSiXpWDUw+fsBO Pk6ah10C4+R1Jc7dyUsKksMfvvhRX1hTIXhth85H16706bneTayZBhlZ/hK18uqTX+s0onG/ m1F3vYvdlE4p2ts1mmixMF7KajN9/E5RQtiSArvKTbfsB6Two4MthIuLuf+M0mI4gPl9SPlf fWCYVPhaU9o83y1KFbD/+lh1pjP7bEu/YudBvz7F2Myjh4/9GUAijrCTNeDTDAgvIJDjXuLX pA== Message-ID: <5d3ee4bb-59aa-b1bb-41b5-4e0d80f1638f@sandeen.net> Date: Wed, 3 Jul 2019 08:55:35 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190702181547.GA11316@hari-Inspiron-1545> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/2/19 1:15 PM, Hariprasad Kelam wrote: > Change return types of below functions as they never fails > xfs_log_mount_cancel > xlog_recover_cancel > xlog_recover_cancel_intents > > fix below issue reported by coccicheck > fs/xfs/xfs_log_recover.c:4886:7-12: Unneeded variable: "error". Return > "0" on line 4926 > > Signed-off-by: Hariprasad Kelam Looks fine, the highest caller in the chain (calling xfs_log_mount_cancel) doesn't use the return value, either. Reviewed-by: Eric Sandeen > --- > fs/xfs/xfs_log.c | 8 ++------ > fs/xfs/xfs_log.h | 2 +- > fs/xfs/xfs_log_priv.h | 2 +- > fs/xfs/xfs_log_recover.c | 12 +++--------- > 4 files changed, 7 insertions(+), 17 deletions(-) > > diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c > index cbaf348..00e9f5c 100644 > --- a/fs/xfs/xfs_log.c > +++ b/fs/xfs/xfs_log.c > @@ -769,16 +769,12 @@ xfs_log_mount_finish( > * The mount has failed. Cancel the recovery if it hasn't completed and destroy > * the log. > */ > -int > +void > xfs_log_mount_cancel( > struct xfs_mount *mp) > { > - int error; > - > - error = xlog_recover_cancel(mp->m_log); > + xlog_recover_cancel(mp->m_log); > xfs_log_unmount(mp); > - > - return error; > } > > /* > diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h > index f27b1cb..84e0680 100644 > --- a/fs/xfs/xfs_log.h > +++ b/fs/xfs/xfs_log.h > @@ -117,7 +117,7 @@ int xfs_log_mount(struct xfs_mount *mp, > xfs_daddr_t start_block, > int num_bblocks); > int xfs_log_mount_finish(struct xfs_mount *mp); > -int xfs_log_mount_cancel(struct xfs_mount *); > +void xfs_log_mount_cancel(struct xfs_mount *); > xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp); > xfs_lsn_t xlog_assign_tail_lsn_locked(struct xfs_mount *mp); > void xfs_log_space_wake(struct xfs_mount *mp); > diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h > index 8acacbc..b880c23 100644 > --- a/fs/xfs/xfs_log_priv.h > +++ b/fs/xfs/xfs_log_priv.h > @@ -418,7 +418,7 @@ xlog_recover( > extern int > xlog_recover_finish( > struct xlog *log); > -extern int > +extern void > xlog_recover_cancel(struct xlog *); > > extern __le32 xlog_cksum(struct xlog *log, struct xlog_rec_header *rhead, > diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c > index 1fc70ac..13d1d3e 100644 > --- a/fs/xfs/xfs_log_recover.c > +++ b/fs/xfs/xfs_log_recover.c > @@ -4875,12 +4875,11 @@ xlog_recover_process_intents( > * A cancel occurs when the mount has failed and we're bailing out. > * Release all pending log intent items so they don't pin the AIL. > */ > -STATIC int > +STATIC void > xlog_recover_cancel_intents( > struct xlog *log) > { > struct xfs_log_item *lip; > - int error = 0; > struct xfs_ail_cursor cur; > struct xfs_ail *ailp; > > @@ -4920,7 +4919,6 @@ xlog_recover_cancel_intents( > > xfs_trans_ail_cursor_done(&cur); > spin_unlock(&ailp->ail_lock); > - return error; > } > > /* > @@ -5779,16 +5777,12 @@ xlog_recover_finish( > return 0; > } > > -int > +void > xlog_recover_cancel( > struct xlog *log) > { > - int error = 0; > - > if (log->l_flags & XLOG_RECOVERY_NEEDED) > - error = xlog_recover_cancel_intents(log); > - > - return error; > + xlog_recover_cancel_intents(log); > } > > #if defined(DEBUG) >