Skip to contentSkip to conversation

net: Convert int functions to bool

PATCH Alexey Dobriyan 2 participants 2 messages Sep 13, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Quoted 7 lines

Global function ipv6_rcv_saddr_equal and static functions ipv6_rcv_saddr_equal and ipv4_rcv_saddr_equal currently return int.

bool is slightly more descriptive for these functions so change their return type from int to bool.

From code generation POV "int" is better for non-inlined functions

especially on non-x86.

Patch bloats even x86_64:

	$ ./scripts/bloat-o-meter ../vmlinux-002-do-while ../obj/vmlinux
	add/remove: 0/0 grow/shrink: 2/0 up/down: 3/0 (3)
	function                                     old     new   delta
	inet_rcv_saddr_equal                          38      40      +2
	inet_csk_get_port                           1300    1301      +1
	Total: Before=6084708, After=6084711, chg +0.00%
#1 lore raw
Quoted 8 lines · Alexey Dobriyan
Quoted 5 lines

Global function ipv6_rcv_saddr_equal and static functions ipv6_rcv_saddr_equal and ipv4_rcv_saddr_equal currently return int.

bool is slightly more descriptive for these functions so change their return type from int to bool.

From code generation POV "int" is better for non-inlined functions especially on non-x86.

I don't agree with you here. For instance:

$ size net/ipv4/*.o*
   text	   data	    bss	    dec	    hex	filename
   9832	     26	      0	   9858	   2682	net/ipv4/inet_connection_sock.o.arm.defconfig.new
   9860	     26	      0	   9886	   269e	net/ipv4/inet_connection_sock.o.arm.defconfig.old