Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754590AbdGUT0O (ORCPT ); Fri, 21 Jul 2017 15:26:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:41288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752780AbdGUT0M (ORCPT ); Fri, 21 Jul 2017 15:26:12 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D13EB22B6E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=sstabellini@kernel.org Date: Fri, 21 Jul 2017 12:26:11 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-X260 To: Arnd Bergmann cc: Boris Ostrovsky , Juergen Gross , Stefano Stabellini , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] xen/pvcalls: use WARN_ON(1) instead of __WARN() In-Reply-To: <20170721161757.3336844-1-arnd@arndb.de> Message-ID: References: <20170721161757.3336844-1-arnd@arndb.de> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2060 Lines: 70 On Fri, 21 Jul 2017, Arnd Bergmann wrote: > __WARN() is an internal helper that is only available on > some architectures, but causes a build error e.g. on ARM64 > in some configurations: > > drivers/xen/pvcalls-back.c: In function 'set_backend_state': > drivers/xen/pvcalls-back.c:1097:5: error: implicit declaration of function '__WARN' [-Werror=implicit-function-declaration] > > Unfortunately, there is no equivalent of BUG() that takes no > arguments, but WARN_ON(1) is commonly used in other drivers > and works on all configurations. > > Fixes: 7160378206b2 ("xen/pvcalls: xenbus state handling") > Signed-off-by: Arnd Bergmann Reviewed-by: Stefano Stabellini > --- > drivers/xen/pvcalls-back.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c > index d6c4c4aecb41..00c1a2344330 100644 > --- a/drivers/xen/pvcalls-back.c > +++ b/drivers/xen/pvcalls-back.c > @@ -1094,7 +1094,7 @@ static void set_backend_state(struct xenbus_device *dev, > xenbus_switch_state(dev, XenbusStateClosing); > break; > default: > - __WARN(); > + WARN_ON(1); > } > break; > case XenbusStateInitWait: > @@ -1109,7 +1109,7 @@ static void set_backend_state(struct xenbus_device *dev, > xenbus_switch_state(dev, XenbusStateClosing); > break; > default: > - __WARN(); > + WARN_ON(1); > } > break; > case XenbusStateConnected: > @@ -1123,7 +1123,7 @@ static void set_backend_state(struct xenbus_device *dev, > xenbus_switch_state(dev, XenbusStateClosing); > break; > default: > - __WARN(); > + WARN_ON(1); > } > break; > case XenbusStateClosing: > @@ -1134,11 +1134,11 @@ static void set_backend_state(struct xenbus_device *dev, > xenbus_switch_state(dev, XenbusStateClosed); > break; > default: > - __WARN(); > + WARN_ON(1); > } > break; > default: > - __WARN(); > + WARN_ON(1); > } > } > } > -- > 2.9.0 >