From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 170B4C433C1 for ; Fri, 19 Mar 2021 21:31:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D725A60232 for ; Fri, 19 Mar 2021 21:31:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230510AbhCSVbH (ORCPT ); Fri, 19 Mar 2021 17:31:07 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:38020 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230409AbhCSVar (ORCPT ); Fri, 19 Mar 2021 17:30:47 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lNMhb-00Bx0T-07; Fri, 19 Mar 2021 22:30:39 +0100 Date: Fri, 19 Mar 2021 22:30:38 +0100 From: Andrew Lunn To: Alex Elder Cc: davem@davemloft.net, kuba@kernel.org, bjorn.andersson@linaro.org, evgreen@chromium.org, cpratapa@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 4/4] net: ipa: activate some commented assertions Message-ID: References: <20210319042923.1584593-1-elder@linaro.org> <20210319042923.1584593-5-elder@linaro.org> <7068152e-5e1b-94b2-bcb2-c66e622bd127@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7068152e-5e1b-94b2-bcb2-c66e622bd127@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 19, 2021 at 04:18:32PM -0500, Alex Elder wrote: > On 3/19/21 1:32 PM, Andrew Lunn wrote: > > > @@ -212,7 +213,7 @@ static inline u32 ipa_reg_bcr_val(enum ipa_version version) > > > BCR_HOLB_DROP_L2_IRQ_FMASK | > > > BCR_DUAL_TX_FMASK; > > > - /* assert(version != IPA_VERSION_4_5); */ > > > + ipa_assert(NULL, version != IPA_VERSION_4_5); > > > > Hi Alex > > > > It is impossible to see just looking what the NULL means. And given > > its the first parameter, it should be quite important. I find this API > > pretty bad. > > I actually don't like the first argument. I would have > supplied the main IPA pointer, but that isn't always > visible or available (the GSI code doesn't have the > IPA pointer definition). So I thought instead I could > at least supply the underlying device if available, > and use dev_err(). > > But I wouldn't mind just getting rid of the first > argument and having a failed assertion always call > pr_err() and not dev_err(). > > The thing of most value to me the asserted condition. Hi Alex What you really want to be looking at is adding a WARN_ON_DEV(dev, condition) macro. Andrew