Received: by 10.223.185.116 with SMTP id b49csp4788220wrg; Wed, 7 Mar 2018 00:38:21 -0800 (PST) X-Google-Smtp-Source: AG47ELtONd0kM5oLKMIV26ovJbrKANU9kBxtB0bimhVgDTUjJ8Ke/nkAv3B7rTIN4+V1oJfiNaAH X-Received: by 10.101.91.78 with SMTP id y14mr17593259pgr.243.1520411901330; Wed, 07 Mar 2018 00:38:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520411901; cv=none; d=google.com; s=arc-20160816; b=ldbhQnObI1qOQ/hRQg/CO9QG5usiYLan2rLWLP9fvgyjbA+a5eKpeMPYtA1IiMkgcf UxemTJQp3iG9OZJaqqViMX9y7NQ/i4XPMvWLbR/JTnp+PA5+Qdr1EqfwhavnNHjk/wT4 sG+30xfQVQ/FfEd1iAqSZ5qm8iJzQn7jGvdWsjhKh6AJzO4/XKIv02USRa3wS1pkz0e0 vACl50tYbxHIElaqepGmw0cFjfE0xg3ZHDIXwdbhQPGci46fTrvS8Q5oVWmPQJalniSJ ieuyql4LC9jIjJzoUrASivwNQFgLq72H6AaMbhPaQcaZRwFd2sfHZM8G9YYYiIKq9tdt 1eSQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=MRRDF1rtHYIEGTOsep+8rj5+RWFutL5lTb4wb+4uKQ0=; b=BNAG17sOh/viMDDj/gifOFZrOwgWQX5+wyFYqVYeyJVF5uNZp5CSQedH7RshU8DrOD r2VudtYvsXcz7Y7htO7w2Kav3Diqfzy+SOec5A6MP+WntWFDJXtNWagX6BUVl/m1Gv/o a3DtQHnA2f4ZIRKecXqUGN1aZbgYGKf6oiNCPQ94Q/vwXyyUs0BKtYfPzr5u6ZmGvZhw g+8S8O3oR4AGNtJyNDGtYKVSGQNZqSQb7fSTtEFPMuoyjvm7KaJIxI8yiQCbuMn5gbl8 2CdH1KAU35BFVBU6JIE/uV4NPfaZWpicSjKncFhs6NkFHvXm09gKYksHPRFCzO9eh5cp XolQ== 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 j5si334911pfi.225.2018.03.07.00.38.07; Wed, 07 Mar 2018 00:38:21 -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 S1751280AbeCGIgg (ORCPT + 99 others); Wed, 7 Mar 2018 03:36:36 -0500 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:34303 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751035AbeCGIge (ORCPT ); Wed, 7 Mar 2018 03:36:34 -0500 X-IronPort-AV: E=Sophos;i="5.47,435,1515481200"; d="scan'208";a="12042633" Received: from exsmtp01.microchip.com (HELO email.microchip.com) ([198.175.253.37]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 07 Mar 2018 01:36:33 -0700 Received: from [170.129.234.128] (10.10.76.4) by CHN-SV-EXCH01.mchp-main.com (10.10.76.37) with Microsoft SMTP Server id 14.3.352.0; Wed, 7 Mar 2018 01:36:33 -0700 Subject: Re: [PATCH] staging: most: Remove unnecessary usage of BUG_ON(). To: Quytelda Kahja , , CC: , , , References: <20180306094728.xbhamhpwdphv6kju@mwanda> <20180307013141.23080-1-quytelda@tamalin.org> From: Christian Gromm Organization: Microchip Message-ID: <60990ed8-9464-96a1-c574-d801ddfffdf1@microchip.com> Date: Wed, 7 Mar 2018 09:37:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180307013141.23080-1-quytelda@tamalin.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07.03.2018 02:31, Quytelda Kahja wrote: > 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 Acked-by: Christian Gromm > --- > 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"); >