Received: by 10.223.185.116 with SMTP id b49csp4509982wrg; Tue, 6 Mar 2018 17:52:57 -0800 (PST) X-Google-Smtp-Source: AG47ELso0NLaGS48/TJ5qVA07Vjxd//SSpZszvce4eU294j+LX6sbpk84Xi11AfLSFO9DWq9PndU X-Received: by 10.99.173.79 with SMTP id y15mr16645277pgo.136.1520387576961; Tue, 06 Mar 2018 17:52:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520387576; cv=none; d=google.com; s=arc-20160816; b=CgQaU3FdJjroTeMzgF/JbszrW8qD1NEbfapDyoyzK6SJloZPC7sgIvfTXq1URRneJm AFDlN7r8izb7V9cJtj/kQj/TN7Rf1CdLbFWx7ObWVwsVLv59q/nvhxW5EU6v2bvHn8Yt lQbA020HxoVIzGG3fU7SjTIzqoFza4dB0piucSh1MB6HEJWu3cocgELi0KM53tEYaeTs T7CV2oymkfu1D1d/XCB8L1Zf7GtA+Slle1GzuxflmWr7/ELR5glQ2j+ZrgtKqmp/SvOB qo4pLG7pvVIMJVWyca2tVylh+fqQ7ESvP+7w9C3lWkmmqQHShUsbeyxtWPboSuChx+Wl 4PRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=pytg6fmrU9D6/i3M4u2Rs9bIkwl7bmp7Dtyno6obgoo=; b=StCojdTtONEinAJ7Pmj5CVuOzrFQXe52j2wE0HBmyt+sZIRqWDNo8DZeRZcOJQImzy VOETK+D3FIOZSQ2g5PDw8CWyRHwY1zpAmp3e1i0qwGZpUOgBEgLxf5PaJ4LePzoPhuHD kvv+CR4omGGMPjr7+u/iGqyyFnabQUTKpq95/0R2UH1bD8QshV9+9w4abNV6r7xK8bzu QLvh2abWTkbjIdcthSiGDFk+3nzlcMw3vVZMLnc0IPbrDL8499jDcf8TUjHfzldCclqp UDXJMsgWieN9yWEuGbNS0A0alRHFrHBKBIjVr98xYUWGT0v+WGGpvvnJ96mJqfLVMLHf yvSg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si12889944pfd.188.2018.03.06.17.52.06; Tue, 06 Mar 2018 17:52:56 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933513AbeCGBg7 (ORCPT + 99 others); Tue, 6 Mar 2018 20:36:59 -0500 Received: from mout.perfora.net ([74.208.4.196]:42377 "EHLO mout.perfora.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933100AbeCGBg6 (ORCPT ); Tue, 6 Mar 2018 20:36:58 -0500 Received: from kahja.local ([73.170.116.139]) by mrelay.perfora.net (mreueus001 [74.208.5.2]) with ESMTPSA (Nemesis) id 0MPnbo-1eoSFr3IBu-0053dP; Wed, 07 Mar 2018 02:31:50 +0100 From: Quytelda Kahja To: gregkh@linuxfoundation.org, dan.carpenter@oracle.com Cc: devel@driverdev.osuosl.org, christian.gromm@microchip.com, chris@engineersdelight.de, linux-kernel@vger.kernel.org, Michael.Fabry@microchip.com, Quytelda Kahja Subject: [PATCH] staging: most: Remove unnecessary usage of BUG_ON(). Date: Tue, 6 Mar 2018 17:31:41 -0800 Message-Id: <20180307013141.23080-1-quytelda@tamalin.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180306094728.xbhamhpwdphv6kju@mwanda> References: <20180306094728.xbhamhpwdphv6kju@mwanda> X-Provags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sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no need for the calls to BUG_ON() in this driver, which are used to check if mbo or mbo->context are NULL; mbo is never NULL, and if mbo->context is NULL it would have already been dereferenced and oopsed before reaching the BUG_ON(). Signed-off-by: Quytelda Kahja --- drivers/staging/most/core.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c index 0ab2de5ecf18..3afc25a61643 100644 --- a/drivers/staging/most/core.c +++ b/drivers/staging/most/core.c @@ -915,7 +915,6 @@ static void arm_mbo(struct mbo *mbo) unsigned long flags; struct most_channel *c; - BUG_ON((!mbo) || (!mbo->context)); c = mbo->context; if (c->is_poisoned) { @@ -1018,8 +1017,6 @@ static void most_write_completion(struct mbo *mbo) { struct most_channel *c; - BUG_ON((!mbo) || (!mbo->context)); - c = mbo->context; if (mbo->status == MBO_E_INVAL) pr_info("WARN: Tx MBO status: invalid\n"); -- 2.16.2