lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <efbbe6093b64a5b19f974871d5262d6e75dff2c0.1756639225.git.joeypabalinas@gmail.com>
Date: Sun, 31 Aug 2025 01:47:48 -1000
From: Joey Pabalinas <joeypabalinas@...il.com>
To: linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>, 
	Baolin Wang <baolin.wang@...ux.alibaba.com>, Hugh Dickins <hughd@...gle.com>, 
	Joey Pabalinas <joeypabalinas@...il.com>
Subject: [PATCH] mm/memfd: remove redundant casts

MFD_ALL_FLAGS is already an unsigned int. Remove redundant casts to
unsigned int.

Signed-off-by: Joey Pabalinas <joeypabalinas@...il.com>
---
 mm/memfd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memfd.c b/mm/memfd.c
index bbe679895ef6a191ba..1d109c1acf211b3c3c 100644
--- a/mm/memfd.c
+++ b/mm/memfd.c
@@ -383,15 +383,15 @@ int memfd_check_seals_mmap(struct file *file, vm_flags_t *vm_flags_ptr)
 static int sanitize_flags(unsigned int *flags_ptr)
 {
 	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;
 	}
 
 	/* Invalid if both EXEC and NOEXEC_SEAL are set.*/
-- 
Cheers,
Joey Pabalinas


Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ