[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7520639c-f08b-cb25-1a62-7e3d69981f95@linaro.org>
Date: Fri, 19 Mar 2021 07:40:21 -0500
From: Alex Elder <elder@...aro.org>
To: Leon Romanovsky <leon@...nel.org>
Cc: davem@...emloft.net, kuba@...nel.org, bjorn.andersson@...aro.org,
evgreen@...omium.org, cpratapa@...eaurora.org, elder@...nel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 4/4] net: ipa: activate some commented assertions
On 3/19/21 12:00 AM, Leon Romanovsky wrote:
> On Thu, Mar 18, 2021 at 11:29:23PM -0500, Alex Elder wrote:
>> Convert some commented assertion statements into real calls to
>> ipa_assert(). If the IPA device pointer is available, provide it,
>> otherwise pass NULL for that.
>>
>> There are lots more places to convert, but this serves as an initial
>> verification of the new mechanism. The assertions here implement
>> both runtime and build-time assertions, both with and without the
>> device pointer.
>>
>> Signed-off-by: Alex Elder <elder@...aro.org>
>> ---
>> drivers/net/ipa/ipa_reg.h | 7 ++++---
>> drivers/net/ipa/ipa_table.c | 5 ++++-
>> 2 files changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/ipa/ipa_reg.h b/drivers/net/ipa/ipa_reg.h
>> index 732e691e9aa62..d0de85de9f08d 100644
>> --- a/drivers/net/ipa/ipa_reg.h
>> +++ b/drivers/net/ipa/ipa_reg.h
>> @@ -9,6 +9,7 @@
>> #include <linux/bitfield.h>
>>
>> #include "ipa_version.h"
>> +#include "ipa_assert.h"
>>
>> struct ipa;
>>
>> @@ -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);
>
> This assert will fire for IPA_VERSION_4_2, I doubt that this is
> something you want.
No, it will only fail if version == IPA_VERSION_4_5.
The logic of an assertion is the opposite of BUG_ON().
It fails only if the asserted condition yields false.
-Alex
>
> Thanks
>
Powered by blists - more mailing lists