Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp119731ybj; Thu, 19 Sep 2019 11:36:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdiCJUghLdsVgrMccMeyqe0b55koftBGa6gtZ3yNulhDDAhIsPfDMnWxZ1XpLwVnhdUV4N X-Received: by 2002:aa7:dcd7:: with SMTP id w23mr16068124edu.170.1568918194598; Thu, 19 Sep 2019 11:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568918194; cv=none; d=google.com; s=arc-20160816; b=ZmdgtlgtutA4zNe0WTVtmLV/3T5KWXeIZSeoMqkjRvDZ6C1CvWws5abMtXZ8wuNrRc uDYpIEIyuIAHrn8eK5saBVTrV0nnlAMSrqxSJ+8PIR8MkmlWgQP6PcZotBn+ml2Mcf5s n7yuhgJCEdoBenKAceofyoXBNcvglCwgPM+Fqwlv+xBvR3W7gXSIBhd9O3+9kExpbuSS KA+a4eMGvBUXd7gNRByK8VlpUh5G6sod4JT2SnCqc2vnBg5iDkYTA7OAqNB2zot+CfeJ O0SC5phWx1G6IviXtQTKeOQYP+bQQ4ZWskvl3yoeigptv+GPcqu0aIIrNgrKoO82tXRj dqVQ== 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=xQ8CaRIJYWE6fvV9BTgd+qJ2W9vEFZZIwSG1VIl0aYY=; b=zH3lIpA/PL34qWqMZSQ70JQc0C+3im8L1/cHf9lwhZhgGCJcfV16Wp8GjFn/8PCjVH hPo4+ywSoaN+4iJe9rpSjO9VoRzHihPWQ1pKBlHNnjwOsrBidz/bcOw7M6aEg84ArR1t b15c9m5It/N4q3qB7Ki9i6/1JgOEn0b9UV7YA8nVcdTy7DjP8H78e/LpoNabqgQZn7tQ bwvPl1qlgpw+CxM+ZcyEEqzf5LMH5W9s0FCOP6dHJ7G0t7YfYlNGM+E5t2xT84GP6hiq WLEmOC48aC4oufKIKfwa/w8WCrNXrtG96D69mdL0vgKHR4/1CEJJSQnMa98B1XyGfMMe T90w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ZS/pDHFP"; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 c21si4875024ejs.390.2019.09.19.11.36.09; Thu, 19 Sep 2019 11:36:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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="ZS/pDHFP"; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732732AbfISQkc (ORCPT + 99 others); Thu, 19 Sep 2019 12:40:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:43072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732680AbfISQkc (ORCPT ); Thu, 19 Sep 2019 12:40:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 66A5D2067B; Thu, 19 Sep 2019 16:40:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568911231; bh=qCz7XbvXfrl9oabTRXwqcnH8N8PB63x5aI3wL4H34mU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZS/pDHFPv7jIulCXvFILgjD0pN463LF2IKbKGWNOcgpedvny3d7f7t1aMMsvDlDkn f2bRxD5Te6IezM3nDftV8Jyp17HG2IDX2re+xEVryEr+jESSbktbbAi3RDaz1Teb4y 36k5XpWwueJSOnnv/xhdqWf3Zms2VEfb83LrWp34= Date: Thu, 19 Sep 2019 18:40:29 +0200 From: Greg Kroah-Hartman To: Andrew Lunn Cc: Jerome Pouiller , "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Kalle Valo , "David S . Miller" , David Le Goff Subject: Re: [PATCH 02/20] staging: wfx: add support for I/O access Message-ID: <20190919164029.GA4045207@kroah.com> References: <20190919105153.15285-1-Jerome.Pouiller@silabs.com> <20190919105153.15285-3-Jerome.Pouiller@silabs.com> <20190919163429.GB27277@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190919163429.GB27277@lunn.ch> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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