Thread (1 message) 1 message, 1 author, 2012-04-18

Re: [PATCH 05/11] batman-adv: handle routing code initialization properly

From: Antonio Quartulli <hidden>
Date: 2012-04-18 06:45:05
Also in: batman

On Tue, Apr 17, 2012 at 10:46:30 -0400, David Miller wrote:
From: Antonio Quartulli <redacted>
Date: Tue, 17 Apr 2012 13:58:21 +0200
quoted
@@ -30,10 +30,11 @@
 #include "send.h"
 #include "bat_algo.h"
 
-static void bat_iv_ogm_iface_enable(struct hard_iface *hard_iface)
+static int bat_iv_ogm_iface_enable(struct hard_iface *hard_iface)
 {
 	struct batman_ogm_packet *batman_ogm_packet;
 	unsigned long random_seqno;
+	int res = -1;
 
 	/* randomize initial seqno to avoid collision */
 	get_random_bytes(&random_seqno, sizeof(unsigned long));
Use real error codes, even as a default, instead of meaningless
values like -1.
Actually all these kind of return values are handled internally the batman-adv
code so we didn't care so much to use real error codes. However using real codes
will surely increase readability.

I will modify this patch and I'll try to suggest other developers to use real
codes too.

Thank you.

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help