Skip to content

Commit

Permalink
mm: prevent a warning when casting void* -> enum
Browse files Browse the repository at this point in the history
I recently build the RISC-V port with LLVM trunk, which has introduced a
new warning when casting from a pointer to an enum of a smaller size.
This patch simply casts to a long in the middle to stop the warning.  I'd
be surprised this is the only one in the kernel, but it's the only one I
saw.

Signed-off-by: Palmer Dabbelt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Adam W. Willis <[email protected]>
Signed-off-by: Forenche <[email protected]>
Signed-off-by: clarencelol <[email protected]>
Signed-off-by: Anush02198 <[email protected]>
  • Loading branch information
palmer-dabbelt authored and Anush02198 committed Jun 30, 2021
1 parent 718ee91 commit cd5b089
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/rmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,7 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
struct page *subpage;
bool ret = true;
unsigned long start = address, end;
enum ttu_flags flags = (enum ttu_flags)arg;
enum ttu_flags flags = (enum ttu_flags)(long)arg;

/* munlock has nothing to gain from examining un-locked vmas */
if ((flags & TTU_MUNLOCK) && !(vma->vm_flags & VM_LOCKED))
Expand Down

0 comments on commit cd5b089

Please sign in to comment.