Skip to contentSkip to conversation

+ include-linux-typesh-use-unsigned-int-instead-of-unsigned.patch added to -mm tree

DISCUSSION Alexey Dobriyan 2 participants 3 messages Feb 28, 2019 – Mar 1, 2019 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20190228174109.MrWZN%[email protected]

#1 lore raw

include/linux/types.h typedef u64 dma_addr_t; · line 160

Quoted 12 lines · On Thu, Feb 28, 2019 at 09:41:09AM -0800, [email protected] wrote:
include/linux/types.h renamed from include/linux/types.h~include-linux-typesh-use-unsigned-int-instead-of-unsigned +3 -3
@@ -155,9 +155,9 @@ typedef u64 dma_addr_t;
 typedef u32 dma_addr_t;
 #endif
 
-typedef unsigned __bitwise gfp_t;
-typedef unsigned __bitwise slab_flags_t;
-typedef unsigned __bitwise fmode_t;
+typedef unsigned int __bitwise gfp_t;
+typedef unsigned int __bitwise slab_flags_t;
+typedef unsigned int __bitwise fmode_t;

I don't know if this is desireable. Switching to "unsigned" is better:
1 less token and less 80 column pressure.

Acked-by David S. Miller
#2 lore raw
Quoted 8 lines · Alexey Dobriyan
Quoted 6 lines · On Thu, Feb 28, 2019 at 09:41:09AM -0800, [email protected] wrote:
include/linux/types.h renamed from include/linux/types.h~include-linux-typesh-use-unsigned-int-instead-of-unsigned +0 -0
@@ -155,9 +155,9 @@ typedef u64 dma_addr_t;
 typedef u32 dma_addr_t;
 #endif
 
Quoted 9 lines

include/linux/types.h typedef u64 dma_addr_t; · line 160

Quoted 6 lines
include/linux/types.h renamed from include/linux/types.h~include-linux-typesh-use-unsigned-int-instead-of-unsigned +3 -3
-typedef unsigned __bitwise gfp_t;
-typedef unsigned __bitwise slab_flags_t;
-typedef unsigned __bitwise fmode_t;
+typedef unsigned int __bitwise gfp_t;
+typedef unsigned int __bitwise slab_flags_t;
+typedef unsigned int __bitwise fmode_t;

I don't know if this is desireable. Switching to "unsigned" is better:
1 less token and less 80 column pressure.

See the following commit.

commit a1ce18e4f941d2039aa3bdeee17db968919eac2f

Author: Joe Perches <[email protected]>
Date:   Tue Mar 15 14:58:03 2016 -0700

checkpatch: warn on bare unsigned or signed declarations without int

Kernel style prefers "unsigned int <foo>" over "unsigned <foo>" and "signed int <foo>" over "signed <foo>".

Emit a warning for these simple signed/unsigned <foo> declarations. Fix it too if desired.

Signature · 2 lines
Best Regards
Masahiro Yamada
#3 lore raw
Quoted 21 lines · Masahiro Yamada
Quoted 8 lines · Alexey Dobriyan
Quoted 6 lines · On Thu, Feb 28, 2019 at 09:41:09AM -0800, [email protected] wrote:
include/linux/types.h renamed from include/linux/types.h~include-linux-typesh-use-unsigned-int-instead-of-unsigned +0 -0
@@ -155,9 +155,9 @@ typedef u64 dma_addr_t;
 typedef u32 dma_addr_t;
 #endif
 
Quoted 9 lines

include/linux/types.h typedef u64 dma_addr_t; · line 160

Quoted 6 lines
include/linux/types.h renamed from include/linux/types.h~include-linux-typesh-use-unsigned-int-instead-of-unsigned +3 -3
-typedef unsigned __bitwise gfp_t;
-typedef unsigned __bitwise slab_flags_t;
-typedef unsigned __bitwise fmode_t;
+typedef unsigned int __bitwise gfp_t;
+typedef unsigned int __bitwise slab_flags_t;
+typedef unsigned int __bitwise fmode_t;

I don't know if this is desireable. Switching to "unsigned" is better:
1 less token and less 80 column pressure.

Quoted 1 line

See the following commit.

Ah, checkpatch.pl, how could we live without it.