[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190919164029.GA4045207@kroah.com>
Date: Thu, 19 Sep 2019 18:40:29 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Andrew Lunn <andrew@...n.ch>
Cc: Jerome Pouiller <Jerome.Pouiller@...abs.com>,
"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
"linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Kalle Valo <kvalo@...eaurora.org>,
"David S . Miller" <davem@...emloft.net>,
David Le Goff <David.Legoff@...abs.com>
Subject: Re: [PATCH 02/20] staging: wfx: add support for I/O access
On Thu, Sep 19, 2019 at 06:34:29PM +0200, Andrew Lunn wrote:
> On Thu, Sep 19, 2019 at 10:52:35AM +0000, Jerome Pouiller wrote:
> > +static int wfx_sdio_copy_from_io(void *priv, unsigned int reg_id,
> > + void *dst, size_t count)
> > +{
> > + struct wfx_sdio_priv *bus = priv;
> > + unsigned int sdio_addr = reg_id << 2;
> > + int ret;
> > +
> > + BUG_ON(reg_id > 7);
>
> Hi Jerome
>
> BUG_ON should only be used when the system is corrupted, and there is
> no alternative than to stop the machine, so it does not further
> corrupt itself. Accessing a register which does not exist is not a
> reason the kill the machine. A WARN() and a return of -EINVAL would be
> better.
dev_warn() is even better.
But that's one reason this is going into staging I guess :)
thanks,
greg k-h
Powered by blists - more mailing lists