Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2906555ybb; Fri, 27 Mar 2020 14:25:08 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu59ps33kxbisEE9alzbBZeIq41pIDyuZpybVI1kCjGOfTCHZi8sXYRMMmqXljEAlaLf9C5 X-Received: by 2002:aca:a882:: with SMTP id r124mr685527oie.53.1585344308197; Fri, 27 Mar 2020 14:25:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585344308; cv=none; d=google.com; s=arc-20160816; b=FYjgpFuBJKZzp7EwA7s4RPL9a57VcFvqL8CFOkIJgKuZF0b00Hm14EDCtZ4+vtiBNb jgWrvfbgLB9MdKPZJ8aFHWTUIA7xViwwsXOddL1v6OeuNki0Nw0Dq4P906tdYU/DQicC cHim/1JCOQHK2GwZE7UGvISfWOxYcslQnA1QbRpQSdl41khVKwwOCwDMbxy9+Ddcww2U T1s+Py1Mhn6+8J9T+U6P5wKGYHifrr9C4Xg+jaYkGmNgjBEnecaRZnMeMZYpFnDWY5HM ORaGISbmaDf8p/RptHNcLChhFvCzxctlfSLZAaMHCeSGu5xUUr3BOv/oWGeCFCzJN8uZ By4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H9z2b1vzlSf/N58DfrTHYz48txgfb47zhTeyBqYfVXc=; b=A0ZLk7KbudfUsvaRwk1pG8qNejzkKAVrAY+r5vWEdmIzxqHwG7vy3Ya6iXMuYsxRnI LD3t3971BHu8KLUvz7owj4Kehfq+UhQoiY8BmfP6M7Ta0lurFpocUC10LefBJ8jwXte4 oUHOpNiRtVRXZ88axc9Sigs9EauZ5LmGC9fC5Ir9JFyuBFRClmP6TQP7zvDGvI67izra bBDAcuMRkrxc0vsfuXEs9TVbfCbfAhjpVt/WvoNFTPM2GcmL6fH/aH02cQCXC+KkMXV+ gEJxI1iirjiZkksjQRMhOFb8aC0V2no2HSoeLvbJJmxscoZxKhdWFiZOn7FIOfvxLvoJ 6dlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TW4b0hIG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si2895911otq.90.2020.03.27.14.24.52; Fri, 27 Mar 2020 14:25:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TW4b0hIG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727750AbgC0VYa (ORCPT + 99 others); Fri, 27 Mar 2020 17:24:30 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38006 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727444AbgC0VY1 (ORCPT ); Fri, 27 Mar 2020 17:24:27 -0400 Received: by mail-wr1-f68.google.com with SMTP id s1so13244938wrv.5 for ; Fri, 27 Mar 2020 14:24:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H9z2b1vzlSf/N58DfrTHYz48txgfb47zhTeyBqYfVXc=; b=TW4b0hIGqEvGNtQ0U621TCRq+L09r6ti47QwaD8kglgKGG3/D3EHw+YwXn95H3G7Cv SYelRuedFoqpas5BTTqu7G2LjpntZNLUnhZ488FXj38A0mNXltfijN/zRYEeBVdltKN2 LzFVMek43lyF06Pg4RqNsxlGJdulf7HGQ9lpuzL85aOFc1WhFJH0yrM1xiAHF13n7AFA Ppcy49w3lgICD9EyIVl67SmE9kuHHWgrwQnXwKBE5tzJ7ILSZbj7o15yf1Y0e408Jl7T tAu3HPTuH6tEigAuaGRXNgBpq1oERCkspzQLfMs0CuEsGIF6CeZiMZWAGaYp3BZNo53A vJOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=H9z2b1vzlSf/N58DfrTHYz48txgfb47zhTeyBqYfVXc=; b=So6JNmOfJNipttKVsI3esg+9YysWg18K767P5IdRMA/fYd4u+silfY4nu8SwqDrNdG hzz0g9L10/GIds6U1+8WxByMd/tweCB1/aChkKpcEN9PFVxihg59K58M2/OIQAqDVvI6 tm3bReII1EfjZUdsxx3pwDwlAm+4NUii6AOycsy2Bn750hkI/QAOYLr1xG+mslZEwuZ7 t21BI5lvdplRIf/QSAW3avifpgNgi2+CTPeTRq0zJRUIasP8ZtgrlOLpk4tmnQJP3zch EY174KwgysFP37OtVCe4Q5Aqxt/7adi2HWgFG6s8eJBIDXtJN5Vl8Oz8zxwp4FYsKiZt Q5SA== X-Gm-Message-State: ANhLgQ3tlnVk9HEOYA+V4ChAWV0dZx3Rrl5+BmKBugj7Vzea/PDCbvRg 2b3Q1vwGKFSS0Sl5e/q8jA== X-Received: by 2002:a5d:4e03:: with SMTP id p3mr1476977wrt.408.1585344264601; Fri, 27 Mar 2020 14:24:24 -0700 (PDT) Received: from ninjahost.lan (host-92-23-82-35.as13285.net. [92.23.82.35]) by smtp.gmail.com with ESMTPSA id h132sm10215141wmf.18.2020.03.27.14.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2020 14:24:24 -0700 (PDT) From: Jules Irenge To: julia.lawall@lip6.fr Cc: boqun.feng@gmail.com, Thomas Gleixner , Armijn Hemel , Greg Kroah-Hartman , Muchun Song , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 05/10] softirq: Replace BUG() after if statement with BUG_ON Date: Fri, 27 Mar 2020 21:23:52 +0000 Message-Id: <20200327212358.5752-6-jbi.octave@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200327212358.5752-1-jbi.octave@gmail.com> References: <0/10> <20200327212358.5752-1-jbi.octave@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Coccinelle reports a warning tasklet_action_common() WARNING: Use BUG_ON instead of if condition followed by BUG To fix this, BUG() is replaced by BUG_ON() with the recommended suggestion Signed-off-by: Jules Irenge --- kernel/softirq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/softirq.c b/kernel/softirq.c index 0427a86743a4..8a8f6ea0ff0a 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -517,9 +517,8 @@ static void tasklet_action_common(struct softirq_action *a, if (tasklet_trylock(t)) { if (!atomic_read(&t->count)) { - if (!test_and_clear_bit(TASKLET_STATE_SCHED, - &t->state)) - BUG(); + BUG_ON(!test_and_clear_bit(TASKLET_STATE_SCHED, + &t->state)); t->func(t->data); tasklet_unlock(t); continue; -- 2.25.1