Thread (19 messages) flat view 19 messages, 4 authors, 2021-03-20

Re: [PATCH net-next 4/4] net: ipa: activate some commented assertions

From: Andrew Lunn <andrew@lunn.ch>
Date: 2021-03-19 21:31:38
Also in: lkml

On Fri, Mar 19, 2021 at 04:18:32PM -0500, Alex Elder wrote:
On 3/19/21 1:32 PM, Andrew Lunn wrote:
quoted
quoted
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help