* [PATCH] mac80211: Add iface name when calling WARN-ON.
@ 2012-03-09 18:36 greearb
2012-03-10 8:02 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: greearb @ 2012-03-09 18:36 UTC (permalink / raw)
To: linux-wireless; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
This lets the user know which interface has failed
the check_sdata_in_driver check.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 e8960ae... e62e7c3... M net/mac80211/driver-ops.h
net/mac80211/driver-ops.h | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index e8960ae..e62e7c3 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -7,7 +7,11 @@
static inline void check_sdata_in_driver(struct ieee80211_sub_if_data *sdata)
{
- WARN_ON(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER));
+ if (unlikely(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER))) {
+ printk(KERN_ERR "%s: Failed check-sdata-in-driver check, flags: 0x%x\n",
+ sdata->dev->name, sdata->flags);
+ WARN_ON(1);
+ }
}
static inline struct ieee80211_sub_if_data *
--
1.7.3.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mac80211: Add iface name when calling WARN-ON.
2012-03-09 18:36 [PATCH] mac80211: Add iface name when calling WARN-ON greearb
@ 2012-03-10 8:02 ` Johannes Berg
2012-03-10 17:16 ` Ben Greear
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2012-03-10 8:02 UTC (permalink / raw)
To: greearb; +Cc: linux-wireless
On Fri, 2012-03-09 at 10:36 -0800, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> This lets the user know which interface has failed
> the check_sdata_in_driver check.
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
> :100644 100644 e8960ae... e62e7c3... M net/mac80211/driver-ops.h
> net/mac80211/driver-ops.h | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
> index e8960ae..e62e7c3 100644
> --- a/net/mac80211/driver-ops.h
> +++ b/net/mac80211/driver-ops.h
> @@ -7,7 +7,11 @@
>
> static inline void check_sdata_in_driver(struct ieee80211_sub_if_data *sdata)
> {
> - WARN_ON(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER));
> + if (unlikely(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER))) {
> + printk(KERN_ERR "%s: Failed check-sdata-in-driver check, flags: 0x%x\n",
> + sdata->dev->name, sdata->flags);
> + WARN_ON(1);
> + }
How about WARN(!(...), ...) instead -- that way the message will be part
of the warning too.
johannes
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mac80211: Add iface name when calling WARN-ON.
2012-03-10 8:02 ` Johannes Berg
@ 2012-03-10 17:16 ` Ben Greear
2012-03-10 18:01 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Ben Greear @ 2012-03-10 17:16 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
On 03/10/2012 12:02 AM, Johannes Berg wrote:
> On Fri, 2012-03-09 at 10:36 -0800, greearb@candelatech.com wrote:
>> From: Ben Greear<greearb@candelatech.com>
>>
>> This lets the user know which interface has failed
>> the check_sdata_in_driver check.
>>
>> Signed-off-by: Ben Greear<greearb@candelatech.com>
>> ---
>> :100644 100644 e8960ae... e62e7c3... M net/mac80211/driver-ops.h
>> net/mac80211/driver-ops.h | 6 +++++-
>> 1 files changed, 5 insertions(+), 1 deletions(-)
>>
>> diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
>> index e8960ae..e62e7c3 100644
>> --- a/net/mac80211/driver-ops.h
>> +++ b/net/mac80211/driver-ops.h
>> @@ -7,7 +7,11 @@
>>
>> static inline void check_sdata_in_driver(struct ieee80211_sub_if_data *sdata)
>> {
>> - WARN_ON(!(sdata->flags& IEEE80211_SDATA_IN_DRIVER));
>> + if (unlikely(!(sdata->flags& IEEE80211_SDATA_IN_DRIVER))) {
>> + printk(KERN_ERR "%s: Failed check-sdata-in-driver check, flags: 0x%x\n",
>> + sdata->dev->name, sdata->flags);
>> + WARN_ON(1);
>> + }
>
> How about WARN(!(...), ...) instead -- that way the message will be part
> of the warning too.
>
> johannes
Sure. Also, should I maybe un-inline this thing since it is now a bit
bigger code wise?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mac80211: Add iface name when calling WARN-ON.
2012-03-10 17:16 ` Ben Greear
@ 2012-03-10 18:01 ` Joe Perches
0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2012-03-10 18:01 UTC (permalink / raw)
To: Ben Greear; +Cc: Johannes Berg, linux-wireless
On Sat, 2012-03-10 at 09:16 -0800, Ben Greear wrote:
[]
> >> diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
[]
> >> @@ -7,7 +7,11 @@
> >>
> >> static inline void check_sdata_in_driver(struct ieee80211_sub_if_data *sdata)
> >> {
> >> - WARN_ON(!(sdata->flags& IEEE80211_SDATA_IN_DRIVER));
> >> + if (unlikely(!(sdata->flags& IEEE80211_SDATA_IN_DRIVER))) {
> >> + printk(KERN_ERR "%s: Failed check-sdata-in-driver check, flags: 0x%x\n",
> >> + sdata->dev->name, sdata->flags);
Perhaps better as:
netdev_err(sdata->dev, "%s(): Failed check, flags: 0x%x\n",
__func__, sdata->flags);
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-03-10 18:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-09 18:36 [PATCH] mac80211: Add iface name when calling WARN-ON greearb
2012-03-10 8:02 ` Johannes Berg
2012-03-10 17:16 ` Ben Greear
2012-03-10 18:01 ` Joe Perches
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.