* [PATCH 0/3] Misc fixes for problems found by checkpatch
@ 2018-07-06 8:12 Stefan Schmidt
2018-07-06 8:12 ` [PATCH 1/3] ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Stefan Schmidt @ 2018-07-06 8:12 UTC (permalink / raw)
To: aring; +Cc: linux-wpan, Stefan Schmidt
Hello.
I just relasied these three patches from an earlier batch have never been
applied. (Thanks patchwork for allowing me to stay on top of things).
Alex, I think the reason I did not apply them was that I waited for ACK's on
them.
Stefan Schmidt (3):
ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem
ieee802154: at86rf230: use __func__ macro for debug messages
ieee802154: fakelb: switch from BUG_ON() to WARN_ON() on problem
drivers/net/ieee802154/at86rf230.c | 15 +++++----------
drivers/net/ieee802154/fakelb.c | 2 +-
2 files changed, 6 insertions(+), 11 deletions(-)
regards
Stefan Schmidt
--
2.14.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem
2018-07-06 8:12 [PATCH 0/3] Misc fixes for problems found by checkpatch Stefan Schmidt
@ 2018-07-06 8:12 ` Stefan Schmidt
2018-07-06 8:12 ` [PATCH 2/3] ieee802154: at86rf230: use __func__ macro for debug messages Stefan Schmidt
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Stefan Schmidt @ 2018-07-06 8:12 UTC (permalink / raw)
To: aring; +Cc: linux-wpan, Stefan Schmidt
The check is valid but it does not warrant to crash the kernel. A
WARN_ON() is good enough here.
Found by checkpatch.
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
---
drivers/net/ieee802154/at86rf230.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 77abedf0b524..7b3a381d198a 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -940,7 +940,7 @@ at86rf230_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
static int
at86rf230_ed(struct ieee802154_hw *hw, u8 *level)
{
- BUG_ON(!level);
+ WARN_ON(!level);
*level = 0xbe;
return 0;
}
--
2.14.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] ieee802154: at86rf230: use __func__ macro for debug messages
2018-07-06 8:12 [PATCH 0/3] Misc fixes for problems found by checkpatch Stefan Schmidt
2018-07-06 8:12 ` [PATCH 1/3] ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
@ 2018-07-06 8:12 ` Stefan Schmidt
2018-07-06 8:12 ` [PATCH 3/3] ieee802154: fakelb: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
2018-07-07 16:03 ` [PATCH 0/3] Misc fixes for problems found by checkpatch Alexander Aring
3 siblings, 0 replies; 6+ messages in thread
From: Stefan Schmidt @ 2018-07-06 8:12 UTC (permalink / raw)
To: aring; +Cc: linux-wpan, Stefan Schmidt
Instead of having the function name hard-coded (it might change and we
forgot to update them in the debug output) we can use __func__ instead
and also shorter the line so we do not need to break it. Also fix an
extra blank line while being here.
Found by checkpatch.
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
---
drivers/net/ieee802154/at86rf230.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 7b3a381d198a..3d9e91579866 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -1121,8 +1121,7 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw,
if (changed & IEEE802154_AFILT_SADDR_CHANGED) {
u16 addr = le16_to_cpu(filt->short_addr);
- dev_vdbg(&lp->spi->dev,
- "at86rf230_set_hw_addr_filt called for saddr\n");
+ dev_vdbg(&lp->spi->dev, "%s called for saddr\n", __func__);
__at86rf230_write(lp, RG_SHORT_ADDR_0, addr);
__at86rf230_write(lp, RG_SHORT_ADDR_1, addr >> 8);
}
@@ -1130,8 +1129,7 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw,
if (changed & IEEE802154_AFILT_PANID_CHANGED) {
u16 pan = le16_to_cpu(filt->pan_id);
- dev_vdbg(&lp->spi->dev,
- "at86rf230_set_hw_addr_filt called for pan id\n");
+ dev_vdbg(&lp->spi->dev, "%s called for pan id\n", __func__);
__at86rf230_write(lp, RG_PAN_ID_0, pan);
__at86rf230_write(lp, RG_PAN_ID_1, pan >> 8);
}
@@ -1140,15 +1138,13 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw,
u8 i, addr[8];
memcpy(addr, &filt->ieee_addr, 8);
- dev_vdbg(&lp->spi->dev,
- "at86rf230_set_hw_addr_filt called for IEEE addr\n");
+ dev_vdbg(&lp->spi->dev, "%s called for IEEE addr\n", __func__);
for (i = 0; i < 8; i++)
__at86rf230_write(lp, RG_IEEE_ADDR_0 + i, addr[i]);
}
if (changed & IEEE802154_AFILT_PANC_CHANGED) {
- dev_vdbg(&lp->spi->dev,
- "at86rf230_set_hw_addr_filt called for panc change\n");
+ dev_vdbg(&lp->spi->dev, "%s called for panc change\n", __func__);
if (filt->pan_coord)
at86rf230_write_subreg(lp, SR_AACK_I_AM_COORD, 1);
else
@@ -1252,7 +1248,6 @@ at86rf230_set_cca_mode(struct ieee802154_hw *hw,
return at86rf230_write_subreg(lp, SR_CCA_MODE, val);
}
-
static int
at86rf230_set_cca_ed_level(struct ieee802154_hw *hw, s32 mbm)
{
--
2.14.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] ieee802154: fakelb: switch from BUG_ON() to WARN_ON() on problem
2018-07-06 8:12 [PATCH 0/3] Misc fixes for problems found by checkpatch Stefan Schmidt
2018-07-06 8:12 ` [PATCH 1/3] ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
2018-07-06 8:12 ` [PATCH 2/3] ieee802154: at86rf230: use __func__ macro for debug messages Stefan Schmidt
@ 2018-07-06 8:12 ` Stefan Schmidt
2018-07-07 16:03 ` [PATCH 0/3] Misc fixes for problems found by checkpatch Alexander Aring
3 siblings, 0 replies; 6+ messages in thread
From: Stefan Schmidt @ 2018-07-06 8:12 UTC (permalink / raw)
To: aring; +Cc: linux-wpan, Stefan Schmidt
The check is valid but it does not warrant to crash the kernel. A
WARN_ON() is good enough here.
Found by checkpatch.
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
---
drivers/net/ieee802154/fakelb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
index 0d673f7682ee..176395e4b7bb 100644
--- a/drivers/net/ieee802154/fakelb.c
+++ b/drivers/net/ieee802154/fakelb.c
@@ -49,7 +49,7 @@ struct fakelb_phy {
static int fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level)
{
- BUG_ON(!level);
+ WARN_ON(!level);
*level = 0xbe;
return 0;
--
2.14.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] Misc fixes for problems found by checkpatch
2018-07-06 8:12 [PATCH 0/3] Misc fixes for problems found by checkpatch Stefan Schmidt
` (2 preceding siblings ...)
2018-07-06 8:12 ` [PATCH 3/3] ieee802154: fakelb: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
@ 2018-07-07 16:03 ` Alexander Aring
2018-07-09 8:28 ` Stefan Schmidt
3 siblings, 1 reply; 6+ messages in thread
From: Alexander Aring @ 2018-07-07 16:03 UTC (permalink / raw)
To: Stefan Schmidt; +Cc: linux-wpan
Hi,
On Fri, Jul 06, 2018 at 10:12:09AM +0200, Stefan Schmidt wrote:
> Hello.
>
> I just relasied these three patches from an earlier batch have never been
> applied. (Thanks patchwork for allowing me to stay on top of things).
>
> Alex, I think the reason I did not apply them was that I waited for ACK's on
> them.
>
I have no problem with them...
btw: you know we don't use the energy detection callback at all _yet_?
- Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] Misc fixes for problems found by checkpatch
2018-07-07 16:03 ` [PATCH 0/3] Misc fixes for problems found by checkpatch Alexander Aring
@ 2018-07-09 8:28 ` Stefan Schmidt
0 siblings, 0 replies; 6+ messages in thread
From: Stefan Schmidt @ 2018-07-09 8:28 UTC (permalink / raw)
To: Alexander Aring; +Cc: linux-wpan
Hello Alex.
On 07.07.2018 18:03, Alexander Aring wrote:
> Hi,
>
> On Fri, Jul 06, 2018 at 10:12:09AM +0200, Stefan Schmidt wrote:
>> Hello.
>>
>> I just relasied these three patches from an earlier batch have never been
>> applied. (Thanks patchwork for allowing me to stay on top of things).
>>
>> Alex, I think the reason I did not apply them was that I waited for ACK's on
>> them.
>>
>
> I have no problem with them...
Good, all three applied and pushed now.
>
> btw: you know we don't use the energy detection callback at all _yet_?
I know, something we need to fix at some point. :-)
regards
Stefan Schmidt
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-07-09 8:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-06 8:12 [PATCH 0/3] Misc fixes for problems found by checkpatch Stefan Schmidt
2018-07-06 8:12 ` [PATCH 1/3] ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
2018-07-06 8:12 ` [PATCH 2/3] ieee802154: at86rf230: use __func__ macro for debug messages Stefan Schmidt
2018-07-06 8:12 ` [PATCH 3/3] ieee802154: fakelb: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
2018-07-07 16:03 ` [PATCH 0/3] Misc fixes for problems found by checkpatch Alexander Aring
2018-07-09 8:28 ` Stefan Schmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).