Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp987833ybi; Wed, 3 Jul 2019 07:40:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqytPADVCSP9q9s3Q1mVIRmbD9M5T91LpZTbiYYKJuBfJs8ZR81yBebvAxa21zAcOoFIUdJO X-Received: by 2002:a65:48c3:: with SMTP id o3mr35103540pgs.70.1562164822038; Wed, 03 Jul 2019 07:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562164822; cv=none; d=google.com; s=arc-20160816; b=n+h9eVJTjmvy0J94VCyHbW86TqNLU7ag8IL3oa/f0lnGR9oEErWpO3MeAZbwWKz3+/ StLBNElEj2fqAAAwNld4RdWkfxUClXTsI48bKCgxT6rt/fIKFjK8OcI+1s9NZRN5TkN9 B7D8YAVqblI/6dqB/qnCW5mVa78JHEpNS6CXv/GokIRpqNu6YKLN6QGBzY2ZSaBVBd8V Sud7K7I201xaESrqv4nhCKygcVQsIqK6oixVQMhDvKHu19GMNXKjQT4pTS6Ya5+krp4G dJDpn+ZkeO5hoVoNr1vEbQZ7LOhdgg0a5vcYcRvH5yjx0BQhMpWvccupIsu7rpl7hQX/ 72rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=lasZq5Fz9C40OGegUP6w040GqTacb+hR2lXsMebzF7Y=; b=QiDutyF2hoGumjIBJPBcB6Qe1RC+45MG3OqTJEUHSL2gUKDXwpsB57ayBvco8t2E17 rjAlNeGh5MtZKXJSLhAZDjaRqpymu2LKqNYKYni3XAbeS+x5N6gd+gNHGtRvVzk4W1T5 asvWuNHCN1m/rCITGO+1k/PQSRSSpAisAMCmYoC7SUcakB11fSb+I9M0ZZjOKRUrtdtW K9fDl6UkQHjGOPDO9GzYORTuYnOio5VoD4U1sUmy5XBD9GSDBRazfW2eww++IRhoYXNX DW0xCYRYJVgfh5sSOEypI+LNmtelkNz09Bx/zq5g8HOQe0IFGEhXvQWSUI6o4ZyaTTnn FADw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y66si2379425pfy.197.2019.07.03.07.40.06; Wed, 03 Jul 2019 07:40:22 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727261AbfGCOiD (ORCPT + 99 others); Wed, 3 Jul 2019 10:38:03 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43685 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbfGCOiC (ORCPT ); Wed, 3 Jul 2019 10:38:02 -0400 Received: by mail-wr1-f68.google.com with SMTP id p13so3086307wru.10 for ; Wed, 03 Jul 2019 07:38:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=lasZq5Fz9C40OGegUP6w040GqTacb+hR2lXsMebzF7Y=; b=g3ts4SQMzif5YJyxyE96um2xJOyYQi4ZNgQwAx7y2MTh2mi9aOHYp1R6uIXhzSKT1O d34yk5AEj5Gwx5hZEBdXIRCB0Yz4FtvuAkV3kKbiBJ0sPSrX3Qg0dpp/n1pq9YFy85oe vXMLVdq2U8C4nTa7tyTaSlDHINY7nauC5kWQD9btOZAM5dfrhLwieCjqSDyYpS/vJ8Ax VERVh6eGAl9VVgrn5YyZdZlIvmPF5ser0MVwnLRm7lzY8iG2oah/20/9bomUfvVk/7IE 4P2LHJZicy17Tp5YjQPHpgheq+8Y2RJHbUe/MmUPs9wCLaGVsd8tI/LVNLvVlm8FHy4v 3fyA== X-Gm-Message-State: APjAAAXmLbIWD2yYZYwRIgBOpRI+OtApKhRfHfjytktmrsgBYqTm+xjH QAcmFBqyjzYlUnBD078T6SCqiw== X-Received: by 2002:a5d:498f:: with SMTP id r15mr1599385wrq.353.1562164681463; Wed, 03 Jul 2019 07:38:01 -0700 (PDT) Received: from pegasus.maiolino.io (ip-89-103-126-188.net.upcbroadband.cz. [89.103.126.188]) by smtp.gmail.com with ESMTPSA id z19sm1672780wmi.7.2019.07.03.07.38.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 03 Jul 2019 07:38:00 -0700 (PDT) Date: Wed, 3 Jul 2019 16:37:59 +0200 From: Carlos Maiolino To: Hariprasad Kelam Cc: "Darrick J. Wong" , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs: xfs: xfs_log: Change return type from int to void Message-ID: <20190703143759.qczx4dnjhslh3gys@pegasus.maiolino.io> Mail-Followup-To: Hariprasad Kelam , "Darrick J. Wong" , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190702181547.GA11316@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190702181547.GA11316@hari-Inspiron-1545> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 02, 2019 at 11:45:47PM +0530, 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 ok. You can add: Reviewed-by: Carlos Maiolino > --- > 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) > -- > 2.7.4 > -- Carlos