Skip to contentSkip to conversation

batctl: Replace C99 int types with kernel type

PATCH Applied Sven Eckelmann 2 participants 2 messages Jun 11, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batctl: Replace C99 int types with kernel type

(s|u)(8|16|32|64) are the preferred types in the kernel. The use of the standard C99 types u?int(8|16|32|64)_t are objected by some people and even checkpatch now warns about using them.

---
 main.h   |   5 ++
 packet.h | 204 +++++++++++++++++++++++++++++++--------------------------------
 2 files changed, 107 insertions(+), 102 deletions(-)
main.h +5 -0
index d96ce94..a3ae5f6 100644
@@ -22,6 +22,8 @@
 #ifndef _BATCTL_MAIN_H
 #define _BATCTL_MAIN_H
 
+#include <stdint.h>
+
 #ifndef SOURCE_VERSION
 #define SOURCE_VERSION "2015.0"
 #endif
@@ -47,6 +49,9 @@
 #define __packed __attribute((packed))   /* linux kernel compat */
 #define BIT(nr)                 (1UL << (nr)) /* linux kernel compat */
 
+typedef uint8_t u8; /* linux kernel compat */
+typedef uint16_t u16; /* linux kernel compat */
+
 extern char module_ver_path[];
 
 #ifndef VLAN_VID_MASK
packet.h +102 -102

311 lines not on this page · raw message

Signature · 1 line
2.1.4
#1 lore raw
Quoted 10 lines · On Thursday, June 11, 2015 12:47:53 Sven Eckelmann wrote:

(s|u)(8|16|32|64) are the preferred types in the kernel. The use of the standard C99 types u?int(8|16|32|64)_t are objected by some people and even checkpatch now warns about using them.

---
 main.h   |   5 ++
 packet.h | 204

+++++++++++++++++++++++++++++++-------------------------------- 2 files changed, 107 insertions(+), 102 deletions(-)

Applied in revision 224b5e4.

Thanks,
Marek