From: Pavel Emelyanov Ignoring their return values may result in counter underflow in the future - when the value charged will be uncharged (or in "leaks" - when the value is not uncharged). This also prevents from using charging routines to decrement the counter value (i.e. uncharge it) ;) (Current code works OK with res_counter, however :) ) Signed-off-by: Pavel Emelyanov Cc: Balbir Singh Cc: Paul Menage Cc: KAMEZAWA Hiroyuki Signed-off-by: Andrew Morton --- include/linux/res_counter.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff -puN include/linux/res_counter.h~mark-res_counter_charge_locked-with-__must_check include/linux/res_counter.h --- a/include/linux/res_counter.h~mark-res_counter_charge_locked-with-__must_check +++ a/include/linux/res_counter.h @@ -95,8 +95,10 @@ void res_counter_init(struct res_counter * counter->limit _locked call expects the counter->lock to be taken */ -int res_counter_charge_locked(struct res_counter *counter, unsigned long val); -int res_counter_charge(struct res_counter *counter, unsigned long val); +int __must_check res_counter_charge_locked(struct res_counter *counter, + unsigned long val); +int __must_check res_counter_charge(struct res_counter *counter, + unsigned long val); /* * uncharge - tell that some portion of the resource is released _