mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
fs/jfs: replace ternary operator with min_t()
Fix the following coccicheck warning: fs/jfs/super.c:748: WARNING opportunity for min(). fs/jfs/super.c:788: WARNING opportunity for min(). min_t() macro is defined in include/linux/minmax.h. It avoids multiple evaluations of the arguments when non-constant and performs strict type-checking. Signed-off-by: Jiangshan Yi <yijiangshan@kylinos.cn> Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
This commit is contained in:
parent
898f706695
commit
73c6da327f
@ -745,8 +745,7 @@ static ssize_t jfs_quota_read(struct super_block *sb, int type, char *data,
|
||||
len = i_size-off;
|
||||
toread = len;
|
||||
while (toread > 0) {
|
||||
tocopy = sb->s_blocksize - offset < toread ?
|
||||
sb->s_blocksize - offset : toread;
|
||||
tocopy = min_t(size_t, sb->s_blocksize - offset, toread);
|
||||
|
||||
tmp_bh.b_state = 0;
|
||||
tmp_bh.b_size = i_blocksize(inode);
|
||||
@ -785,8 +784,7 @@ static ssize_t jfs_quota_write(struct super_block *sb, int type,
|
||||
|
||||
inode_lock(inode);
|
||||
while (towrite > 0) {
|
||||
tocopy = sb->s_blocksize - offset < towrite ?
|
||||
sb->s_blocksize - offset : towrite;
|
||||
tocopy = min_t(size_t, sb->s_blocksize - offset, towrite);
|
||||
|
||||
tmp_bh.b_state = 0;
|
||||
tmp_bh.b_size = i_blocksize(inode);
|
||||
|
Loading…
Reference in New Issue
Block a user