xfs
[Top] [All Lists]

Re: [PATCH 22/49] xfs: minor cleanups

To: Mark Tinguely <tinguely@xxxxxxx>
Subject: Re: [PATCH 22/49] xfs: minor cleanups
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Sun, 28 Jul 2013 11:07:44 +1000
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <51F40ACA.40601@xxxxxxx>
References: <1374215120-7271-1-git-send-email-david@xxxxxxxxxxxxx> <1374215120-7271-23-git-send-email-david@xxxxxxxxxxxxx> <51F40ACA.40601@xxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Sat, Jul 27, 2013 at 01:00:42PM -0500, Mark Tinguely wrote:
> On 07/19/13 01:24, Dave Chinner wrote:
> >From: Dave Chinner<dchinner@xxxxxxxxxx>
> >
> >These come from syncing the shared userspace and kernel code. Small
> >whitespace and trivial cleanups.
> >
> >Signed-off-by: Dave Chinner<dchinner@xxxxxxxxxx>
> >---
> 
> okay, minor clean-ups
> 
> Don't understand the change from min_t to min:
> 
> >diff --git a/fs/xfs/xfs_attr_remote.c b/fs/xfs/xfs_attr_remote.c
> >index 13a0ed9..b42926a 100644
> >--- a/fs/xfs/xfs_attr_remote.c
> >+++ b/fs/xfs/xfs_attr_remote.c
> >@@ -251,7 +251,7 @@ xfs_attr_rmtval_copyout(
> >             int hdr_size = 0;
> >             int byte_cnt = XFS_ATTR3_RMT_BUF_SPACE(mp, XFS_LBSIZE(mp));
> >
> >-            byte_cnt = min_t(int, *valuelen, byte_cnt);
> >+            byte_cnt = min(*valuelen, byte_cnt);

min_t is only needed when the types being compared are different.
I.e. it ensures the comparison is done with the appropriate casts on
the items being compared. However, both variables being compared
here are of the same type (int) and so the type casting of min_t is
not necessary.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>