Skip to contentSkip to conversation

mac802154: fix typo for device

PATCH In review [email protected] 3 participants 4 messages Apr 9, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac802154: fix typo for device

From: Varka Bhadram <[email protected]>

---
 include/net/mac802154.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/mac802154.h +1 -1
index d6a809e..56ef97a 100644
@@ -247,7 +247,7 @@ static inline void ieee802154_le64_to_be64(void *be64_dst, const void *le64_src)
 	__put_unaligned_memmove64(swab64p(le64_src), be64_dst);
 }
 
-/* Basic interface to register ieee802154 hwice */
+/* Basic interface to register ieee802154 device */
 struct ieee802154_hw *
 ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops);
 void ieee802154_free_hw(struct ieee802154_hw *hw);
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw

Hi Varka,

Quoted 13 lines · On Thu, Apr 09, 2015 at 12:05:43PM +0530, [email protected] wrote:

From: Varka Bhadram <[email protected]>

---
 include/net/mac802154.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/mac802154.h +0 -0
index d6a809e..56ef97a 100644

include/net/mac802154.h static inline void ieee802154_le64_to_be64(void *be64_dst, const void *le64_src) · line 250

Quoted 5 lines
include/net/mac802154.h +1 -1
@@ -247,7 +247,7 @@ static inline void ieee802154_le64_to_be64(void *be64_dst, const void *le64_src)
 	__put_unaligned_memmove64(swab64p(le64_src), be64_dst);
 }
 
-/* Basic interface to register ieee802154 hwice */
+/* Basic interface to register ieee802154 device */

This typo occured when I did a 's/dev/hw/' in my editor. This replaced all dev to hw.

I did this because the variable was always named "dev" which was very confusing to handle between netdev "dev" and this one. Look at commit:

5a50439775853a8d565115edb63a5ab4bb780479 ("ieee802154: rename ieee802154_dev to ieee802154_hw")

For keeping the wireless naming conventation.

This also means that calling this "device" is wrong and "hw" is correct. So we should change the comment to:

/* Basic interface to register ieee802154 hw */

or

/* Basic interface to register ieee802154 hardware */

include/net/mac802154.h static inline void ieee802154_le64_to_be64(void *be64_dst, const void *le64_src) · line 252

Quoted 2 lines
include/net/mac802154.h +0 -0
 struct ieee802154_hw *
 ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops);

This comment is also some kind of useless. What I mean is the comment describes a "basic interface for register ...", better would be a comment above each function like.

/**
* ieee802154_register_hw - register the ieee802154 hardware
* @hw: ieee802154 hardware
*
* Registers the ieee802154 hw struct into the mac802154 subsystem. */
... ieee802154_register_hw ...

/**
* ieee802154_free_hw - your imagination
* @hw: ieee802154 hardware
*
* Your imagination ... the ieee802154_hw should called
* ieee802154_unregister_hw before.
*/
... ieee802154_register_hw ...

Something like that, if you want to change the typo, I am also fine with that. :-)

For general comment style I simple lookup:

include/linux/netdevice.h - how "real" netdev coreapi deals with comments.

btw: I think the most important comments would be for the nl802154 header.

include/net/mac802154.h static inline void ieee802154_le64_to_be64(void *be64_dst, const void *le64_src) · line 253

Quoted 1 line
include/net/mac802154.h +0 -0
 void ieee802154_free_hw(struct ieee802154_hw *hw);

- Alex

#2 lore raw

Hi Alex,

Quoted 27 lines
Quoted 10 lines

---
include/net/mac802154.h | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
include/net/mac802154.h +0 -0
index d6a809e..56ef97a 100644

include/net/mac802154.h static inline void ieee802154_le64_to_be64(void *be64_dst, const void *le64_src) · line 250

Quoted 5 lines
include/net/mac802154.h +1 -1
@@ -247,7 +247,7 @@ static inline void ieee802154_le64_to_be64(void *be64_dst, const void *le64_src)
 	__put_unaligned_memmove64(swab64p(le64_src), be64_dst);
 }
 
-/* Basic interface to register ieee802154 hwice */
+/* Basic interface to register ieee802154 device */

This typo occured when I did a 's/dev/hw/' in my editor. This replaced all dev to hw.

I did this because the variable was always named "dev" which was very confusing to handle between netdev "dev" and this one. Look at commit:

5a50439775853a8d565115edb63a5ab4bb780479 ("ieee802154: rename ieee802154_dev to ieee802154_hw")

For keeping the wireless naming conventation.

Quoted 8 lines

This also means that calling this "device" is wrong and "hw" is correct. So we should change the comment to:

/* Basic interface to register ieee802154 hw */

or

/* Basic interface to register ieee802154 hardware */

so I took this patch already since it was obviously making it better than it was before. Once you decide on how you want to handle the comments, please just send cleanup patches that fix all locations.

Regards

Marcel