Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp2304543img; Sun, 24 Mar 2019 05:21:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzD1bJOf+g0c8K+G9BRLXr4xKEIr78mHoHLlKNL4OhpLhl7xDuHVAYD2Q/b4o7/fHl/qwgl X-Received: by 2002:a17:902:123:: with SMTP id 32mr19496971plb.187.1553430081254; Sun, 24 Mar 2019 05:21:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553430081; cv=none; d=google.com; s=arc-20160816; b=eFGus1vOV4P9Cc8dn76Ka2YEpu8d2UTEkPud5EumeyBcgx3n+LalA0LAadm1VsYOHr FQ3Y8vt1rOv9QSBITC1Do/bhV4SGeDBmFO1u8MBHu11yEHVtSzKUaE3d+G3AjSP3+nh5 FCAzOt94hhHS++ZNcJZ/hWUHPJDxeFCkNQbSYnq2uW8ZNX+JUolTyoCooY52n/+7+p1C aoJow45uTRFXa457Dq4XwV385Tvmx+xb4SAg70qqdtGXBlVtcL43oFslsWRuMwON5lAT XkzEHaLIjQu1/3IM/S0QgU8eSd5UCEb9tx+nAna4GkzW0uFXBc5KHoAzCSX1OSzvUrv6 Q2lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=xT7NuU6QNc8SQTgiNzEmp8hXnqBqqeDM0HG4krfcGII=; b=ukZBSornF6Mz9Aspvyf6jVS8i2or2WdIg9wrr5OaO/UaYWFSy3X7EQqW3Or80Bkue6 ax+oXsnXvGqciVdVu7ZXzoLmd3qcq/nZ0OuXmeE5woKsyQwzIy+PS3/PKzml1oaQNU7F xGeJSXx+v43zTEXAmXQ1W48a8wG7esAszB4xiZqcF1RVOCQFY+oJKhMazCkVx3JEn1Xt ko4L349robMcxwDVr8JhwonwlBrY3ZGB7f7OPmErivPINeAPU8zumkTkvHN2YOOiHpp8 nnK2Kuz9Y9PYrUlQSCYIrzWSpN+nnZYhhhtuhZPChpUYngX+g8jpiM+4wrds68pvc4CF i0HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=arJ8kNgB; 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 s26si10569681pgk.380.2019.03.24.05.21.06; Sun, 24 Mar 2019 05:21:21 -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=@kernel.org header.s=default header.b=arJ8kNgB; 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 S1728731AbfCXMTH (ORCPT + 99 others); Sun, 24 Mar 2019 08:19:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:48222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726160AbfCXMTG (ORCPT ); Sun, 24 Mar 2019 08:19:06 -0400 Received: from localhost (unknown [88.128.80.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 78BAB222B0; Sun, 24 Mar 2019 12:19:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553429946; bh=GMYEsqGc5cVyAdwd+ntKMzWFgRKoxSZLxuh3ZOYmEw0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=arJ8kNgBjjYYT4XhDucKFEGJ3FBF/GtMPS791UfGslL/mA6+HuwlfdsRtwGM2uOgN p5DaT+F65rUwlUhBfZj1s46+tNJ2ztf4gqmTufEfRzz7Z+iY4XTE6snAM+XpJwaaX2 hMs/1XTCwXQ71snGTGUQPyPuXcIdf0Sr1zzZFeKM= Date: Sun, 24 Mar 2019 13:19:01 +0100 From: Greg KH To: Bharath Vedartham Cc: jfrederich@gmail.com, dsd@laptop.org, jon.nettleton@gmail.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [RFC/PATCH] staging: olpc_dcon: Use WARN_ON instead of BUG_ON Message-ID: <20190324121901.GB6569@kroah.com> References: <20190324121208.GA24213@bharath12345-Inspiron-5559> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190324121208.GA24213@bharath12345-Inspiron-5559> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 24, 2019 at 05:42:08PM +0530, Bharath Vedartham wrote: > This is with respect to a checkpatch.pl CHECK: "Avoid crashing the > kernel. Use WARN_ON instead of BUG_ON". But I maybe wrong here. Is a > kernel crash desired if olpc_board_at_least(olpc_board(0xc2)) fails, > will there be inconsistent results if execution continues? > > Signed-off-by: Bharath Vedartham > --- > drivers/staging/olpc_dcon/olpc_dcon.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c > index 6b714f7..900baab7 100644 > --- a/drivers/staging/olpc_dcon/olpc_dcon.c > +++ b/drivers/staging/olpc_dcon/olpc_dcon.c > @@ -138,7 +138,7 @@ static int dcon_bus_stabilize(struct dcon_priv *dcon, int is_powered_down) > } > if (x < 0) { > pr_err("unable to stabilize dcon's smbus, reasserting power and praying.\n"); > - BUG_ON(olpc_board_at_least(olpc_board(0xc2))); > + WARN_ON(olpc_board_at_least(olpc_board(0xc2))); Shouldn't you do something to handle this error, if it can actually happen? Don't just warn and keep on going, if this was all that was needed to fix up these types of issues, we could do it all in one simple search/replace step :) thanks, greg k-h