All of lore.kernel.org
 help / color / mirror / Atom feed
* [djwong-xfs:refactor-log-recovery 284/314] fs/xfs/libxfs/xfs_rtrmap_btree.c:826:28: warning: Same value in both branches of ternary operator. [duplicateValueTernary]
@ 2020-04-13  7:41 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-04-13  7:41 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4027 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git refactor-log-recovery
head:   2dcdc305cfc2b8b1beee483cf8ae5c674d9fac86
commit: 4e8b82b3a52c6adb01092b56a17fc42a073f33a2 [284/314] xfs: create routine to allocate and initialize a realtime rmap btree inode

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>


cppcheck warnings: (new ones prefixed by >>)

>> fs/xfs/libxfs/xfs_rtrmap_btree.c:826:28: warning: Same value in both branches of ternary operator. [duplicateValueTernary]
    ip->i_df.if_broot_bytes = XFS_RTRMAP_BROOT_SPACE_CALC(0, 0);
                              ^
   fs/xfs/libxfs/xfs_rtrmap_btree.c:718:25: warning: The scope of the variable 'fkp' can be reduced. [variableScope]
    struct xfs_rtrmap_key *fkp;
                           ^
   fs/xfs/libxfs/xfs_rtrmap_btree.c:719:12: warning: The scope of the variable 'fpp' can be reduced. [variableScope]
    __be64   *fpp;
              ^
   fs/xfs/libxfs/xfs_rtrmap_btree.c:720:25: warning: The scope of the variable 'tkp' can be reduced. [variableScope]
    struct xfs_rtrmap_key *tkp;
                           ^
   fs/xfs/libxfs/xfs_rtrmap_btree.c:721:12: warning: The scope of the variable 'tpp' can be reduced. [variableScope]
    __be64   *tpp;
              ^
   fs/xfs/libxfs/xfs_rtrmap_btree.c:722:25: warning: The scope of the variable 'frp' can be reduced. [variableScope]
    struct xfs_rtrmap_rec *frp;
                           ^
   fs/xfs/libxfs/xfs_rtrmap_btree.c:723:25: warning: The scope of the variable 'trp' can be reduced. [variableScope]
    struct xfs_rtrmap_rec *trp;
                           ^
   fs/xfs/libxfs/xfs_rtrmap_btree.c:761:25: warning: The scope of the variable 'fkp' can be reduced. [variableScope]
    struct xfs_rtrmap_key *fkp;
                           ^
   fs/xfs/libxfs/xfs_rtrmap_btree.c:762:12: warning: The scope of the variable 'fpp' can be reduced. [variableScope]
    __be64   *fpp;
              ^
   fs/xfs/libxfs/xfs_rtrmap_btree.c:763:25: warning: The scope of the variable 'tkp' can be reduced. [variableScope]
    struct xfs_rtrmap_key *tkp;
                           ^
   fs/xfs/libxfs/xfs_rtrmap_btree.c:764:12: warning: The scope of the variable 'tpp' can be reduced. [variableScope]
    __be64   *tpp;
              ^
   fs/xfs/libxfs/xfs_rtrmap_btree.c:765:25: warning: The scope of the variable 'frp' can be reduced. [variableScope]
    struct xfs_rtrmap_rec *frp;
                           ^
   fs/xfs/libxfs/xfs_rtrmap_btree.c:766:25: warning: The scope of the variable 'trp' can be reduced. [variableScope]
    struct xfs_rtrmap_rec *trp;
                           ^

vim +826 fs/xfs/libxfs/xfs_rtrmap_btree.c

   793	
   794	/*
   795	 * Create a realtime rmap btree inode.  The caller must clean up @ic and
   796	 * release the inode stored in @ipp (if it isn't NULL) regardless of the return
   797	 * value.
   798	 */
   799	int
   800	xfs_rtrmapbt_create(
   801		struct xfs_trans	**tpp,
   802		struct xfs_imeta_end	*ic,
   803		struct xfs_inode	**ipp)
   804	{
   805		struct xfs_mount	*mp = (*tpp)->t_mountp;
   806		struct xfs_inode	*ip;
   807		struct xfs_btree_block	*block;
   808		xfs_ino_t		ino = NULLFSINO;
   809		int			error;
   810	
   811		*ipp = NULL;
   812		error = xfs_imeta_lookup(mp, &XFS_IMETA_RTRMAPBT, &ino);
   813		if (error)
   814			return error;
   815		if (ino != NULLFSINO)
   816			return -EEXIST;
   817	
   818		error = xfs_imeta_create(tpp, &XFS_IMETA_RTRMAPBT, S_IFREG, ipp, ic);
   819		if (error)
   820			return error;
   821	
   822		ip = *ipp;
   823		ip->i_d.di_format = XFS_DINODE_FMT_RMAP;
   824		ASSERT(ip->i_df.if_broot_bytes == 0);
   825		ASSERT(ip->i_df.if_bytes == 0);
 > 826		ip->i_df.if_broot_bytes = XFS_RTRMAP_BROOT_SPACE_CALC(0, 0);

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-13  7:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13  7:41 [djwong-xfs:refactor-log-recovery 284/314] fs/xfs/libxfs/xfs_rtrmap_btree.c:826:28: warning: Same value in both branches of ternary operator. [duplicateValueTernary] kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.