summaryrefslogtreecommitdiffstats
path: root/fs/ntfs3/attrib.c
diff options
context:
space:
mode:
authorKari Argillander <kari.argillander@gmail.com>2021-09-07 16:28:42 +0200
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2021-09-16 16:01:37 +0200
commit6e3331ee34461be37f50912295a2e924a673dbc6 (patch)
tree4e38e7bbcf3cd099ebdfb6b1e546c82f9eeef6b9 /fs/ntfs3/attrib.c
parentfs/ntfs3: Use clamp/max macros instead of comparisons (diff)
downloadlinux-6e3331ee34461be37f50912295a2e924a673dbc6.tar.xz
linux-6e3331ee34461be37f50912295a2e924a673dbc6.zip
fs/ntfs3: Use min/max macros instated of ternary operators
We can make code little bit more readable by using min/max macros. These were found with Coccinelle. Signed-off-by: Kari Argillander <kari.argillander@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/attrib.c')
-rw-r--r--fs/ntfs3/attrib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c
index 12cff28f3e71..c15cc17e3cd9 100644
--- a/fs/ntfs3/attrib.c
+++ b/fs/ntfs3/attrib.c
@@ -8,6 +8,7 @@
#include <linux/fs.h>
#include <linux/slab.h>
+#include <linux/kernel.h>
#include "debug.h"
#include "ntfs.h"
@@ -1961,7 +1962,7 @@ int attr_punch_hole(struct ntfs_inode *ni, u64 vbo, u64 bytes, u32 *frame_size)
return 0;
from = vbo;
- to = (vbo + bytes) < data_size ? (vbo + bytes) : data_size;
+ to = min_t(u64, vbo + bytes, data_size);
memset(Add2Ptr(resident_data(attr_b), from), 0, to - from);
return 0;
}