Thread (3 messages) 3 messages, 2 authors, 2023-12-27

Re: [PATCH v5 03/11] mm/mempolicy: refactor sanitize_mpol_flags for reuse

From: Gregory Price <hidden>
Date: 2023-12-27 20:06:47
Also in: linux-doc, linux-fsdevel, linux-mm, lkml

On Tue, Dec 26, 2023 at 02:05:35AM -0500, Gregory Price wrote:
On Wed, Dec 27, 2023 at 04:39:29PM +0800, Huang, Ying wrote:
quoted
Gregory Price [off-list ref] writes:
quoted
+	unsigned short mode = (*mode_arg & ~MPOL_MODE_FLAGS);
+
+	*flags = *mode_arg & MPOL_MODE_FLAGS;
+	*mode_arg = mode;
It appears that it's unnecessary to introduce a local variable to split
mode/flags.  Just reuse the original code?
Revisiting during fixes: Note the change from int to short.

I chose to make this explicit because validate_mpol_flags takes a short.

I'm fairly sure changing it back throws a truncation warning.

~Gregroy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help