| From: Joey Pabalinas <joeypabalinas@gmail.com> |
| Subject: mm/memfd: remove redundant casts |
| Date: Sun, 31 Aug 2025 01:47:48 -1000 |
| |
| MFD_ALL_FLAGS is already an unsigned int. Remove redundant casts to |
| unsigned int. |
| |
| Link: https://lkml.kernel.org/r/efbbe6093b64a5b19f974871d5262d6e75dff2c0.1756639225.git.joeypabalinas@gmail.com |
| Signed-off-by: Joey Pabalinas <joeypabalinas@gmail.com> |
| Cc: Baolin Wang <baolin.wang@linux.alibaba.com> |
| Cc: Hugh Dickins <hughd@google.com> |
| Cc: Joey Pabalinas <joeypabalinas@gmail.com> |
| Signed-off-by: Andrew Morton <akpm@linux-foundation.org> |
| --- |
| |
| mm/memfd.c | 4 ++-- |
| 1 file changed, 2 insertions(+), 2 deletions(-) |
| |
| --- a/mm/memfd.c~mm-memfd-remove-redundant-casts |
| +++ a/mm/memfd.c |
| @@ -385,11 +385,11 @@ static int sanitize_flags(unsigned int * |
| unsigned int flags = *flags_ptr; |
| |
| if (!(flags & MFD_HUGETLB)) { |
| - if (flags & ~(unsigned int)MFD_ALL_FLAGS) |
| + if (flags & ~MFD_ALL_FLAGS) |
| return -EINVAL; |
| } else { |
| /* Allow huge page size encoding in flags. */ |
| - if (flags & ~(unsigned int)(MFD_ALL_FLAGS | |
| + if (flags & ~(MFD_ALL_FLAGS | |
| (MFD_HUGE_MASK << MFD_HUGE_SHIFT))) |
| return -EINVAL; |
| } |
| _ |