From af03268ececa2aa7e723e1a2c2cd1ff1d84960e3 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Thu, 17 Jun 2021 15:17:28 +1000 Subject: [PATCH] mm-memcg-optimize-user-context-object-stock-access-checkpatch-fixes WARNING: else is not generally useful after a break or return #138: FILE: mm/memcontrol.c:2121: + return &stock->task_obj; + } else { total: 0 errors, 1 warnings, 193 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. ./patches/mm-memcg-optimize-user-context-object-stock-access.patch has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Please run checkpatch prior to sending patches Cc: Alex Shi Cc: Chris Down Cc: Christoph Lameter Cc: David Rientjes Cc: Johannes Weiner Cc: Joonsoo Kim Cc: Masayoshi Mizuma Cc: Matthew Wilcox Cc: Michal Hocko Cc: Muchun Song Cc: Pekka Enberg Cc: Roman Gushchin Cc: Shakeel Butt Cc: Tejun Heo Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Waiman Long Cc: Wei Yang Cc: Xing Zhengjun Cc: Yafang Shao Signed-off-by: Andrew Morton Signed-off-by: Stephen Rothwell --- mm/memcontrol.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 9b99a318da3fd9..e40d75ee1acef0 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2118,11 +2118,11 @@ static inline struct obj_stock *get_obj_stock(unsigned long *pflags) preempt_disable(); stock = this_cpu_ptr(&memcg_stock); return &stock->task_obj; - } else { - local_irq_save(*pflags); - stock = this_cpu_ptr(&memcg_stock); - return &stock->irq_obj; } + + local_irq_save(*pflags); + stock = this_cpu_ptr(&memcg_stock); + return &stock->irq_obj; } static inline void put_obj_stock(unsigned long flags)