Skip to content

Commit 5316b49

Browse files
rgushchinakpm00
authored andcommitted
mm: memcg1: convert charge move flags to unsigned long long
Currently MOVE_ANON and MOVE_FILE flags are defined as integers and it leads to the following Smatch static checker warning: mm/memcontrol-v1.c:609 mem_cgroup_move_charge_write() warn: was expecting a 64 bit value instead of '~(1 | 2)' Fix this be redefining them as unsigned long long. Even though the issue allows to set high 32 bits of mc.flags to an arbitrary number, these bits are never used, so it doesn't have any significant consequences. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Roman Gushchin <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 6ab42fe commit 5316b49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/memcontrol-v1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ static struct mem_cgroup_tree soft_limit_tree __read_mostly;
4444
/*
4545
* Types of charges to be moved.
4646
*/
47-
#define MOVE_ANON 0x1U
48-
#define MOVE_FILE 0x2U
47+
#define MOVE_ANON 0x1ULL
48+
#define MOVE_FILE 0x2ULL
4949
#define MOVE_MASK (MOVE_ANON | MOVE_FILE)
5050

5151
/* "mc" and its members are protected by cgroup_mutex */

0 commit comments

Comments
 (0)