mm/vmpressure.c: fix a signedness bug in vmpressure_register_event()

The "mode" and "level" variables are enums and in this context GCC will
treat them as unsigned ints so the error handling is never triggered.

I also removed the bogus initializer because it isn't required any more
and it's sort of confusing.

[ reduce implicit and explicit typecasting]
[ fix return value, add comment, per Matthew]
Fixes: 3cadfa2b9497 ("mm/vmpressure.c: convert to use match_string() helper")
Signed-off-by: Dan Carpenter <>
Reviewed-by: Andy Shevchenko <>
Acked-by: David Rientjes <>
Reviewed-by: Matthew Wilcox <>
Cc: Greg Kroah-Hartman <>
Cc: Thomas Gleixner <>
Cc: Enrico Weigelt <>
Cc: Kate Stewart <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
1 file changed