Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs: xfs: xfs_log: Change return type from int to void

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 <hariprasad.kelam@gmail.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

authored by

Hariprasad Kelam and committed by
Darrick J. Wong
a7a9250e 3e5a428b

+7 -17
+2 -6
fs/xfs/xfs_log.c
··· 769 769 * The mount has failed. Cancel the recovery if it hasn't completed and destroy 770 770 * the log. 771 771 */ 772 - int 772 + void 773 773 xfs_log_mount_cancel( 774 774 struct xfs_mount *mp) 775 775 { 776 - int error; 777 - 778 - error = xlog_recover_cancel(mp->m_log); 776 + xlog_recover_cancel(mp->m_log); 779 777 xfs_log_unmount(mp); 780 - 781 - return error; 782 778 } 783 779 784 780 /*
+1 -1
fs/xfs/xfs_log.h
··· 117 117 xfs_daddr_t start_block, 118 118 int num_bblocks); 119 119 int xfs_log_mount_finish(struct xfs_mount *mp); 120 - int xfs_log_mount_cancel(struct xfs_mount *); 120 + void xfs_log_mount_cancel(struct xfs_mount *); 121 121 xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp); 122 122 xfs_lsn_t xlog_assign_tail_lsn_locked(struct xfs_mount *mp); 123 123 void xfs_log_space_wake(struct xfs_mount *mp);
+1 -1
fs/xfs/xfs_log_priv.h
··· 418 418 extern int 419 419 xlog_recover_finish( 420 420 struct xlog *log); 421 - extern int 421 + extern void 422 422 xlog_recover_cancel(struct xlog *); 423 423 424 424 extern __le32 xlog_cksum(struct xlog *log, struct xlog_rec_header *rhead,
+3 -9
fs/xfs/xfs_log_recover.c
··· 4875 4875 * A cancel occurs when the mount has failed and we're bailing out. 4876 4876 * Release all pending log intent items so they don't pin the AIL. 4877 4877 */ 4878 - STATIC int 4878 + STATIC void 4879 4879 xlog_recover_cancel_intents( 4880 4880 struct xlog *log) 4881 4881 { 4882 4882 struct xfs_log_item *lip; 4883 - int error = 0; 4884 4883 struct xfs_ail_cursor cur; 4885 4884 struct xfs_ail *ailp; 4886 4885 ··· 4919 4920 4920 4921 xfs_trans_ail_cursor_done(&cur); 4921 4922 spin_unlock(&ailp->ail_lock); 4922 - return error; 4923 4923 } 4924 4924 4925 4925 /* ··· 5777 5779 return 0; 5778 5780 } 5779 5781 5780 - int 5782 + void 5781 5783 xlog_recover_cancel( 5782 5784 struct xlog *log) 5783 5785 { 5784 - int error = 0; 5785 - 5786 5786 if (log->l_flags & XLOG_RECOVERY_NEEDED) 5787 - error = xlog_recover_cancel_intents(log); 5788 - 5789 - return error; 5787 + xlog_recover_cancel_intents(log); 5790 5788 } 5791 5789 5792 5790 #if defined(DEBUG)