Skip to contentSkip to conversation

af_llc: fix types on llc_ui_wait_for_conn

PATCH Applied Alan 3 participants 3 messages Feb 15, 2016 – Feb 17, 2016

Subsystems (3)
lore
Share & tools
lore

Alan

author
#0 lore raw

PATCH v2 1/1 af_llc: fix types on llc_ui_wait_for_conn

The timeout is a long, we return it truncated if it is huge. Basically harmless as the only caller does a boolean check, but tidy it up anyway.

(64bit build tested this time. Thank you 0day)

---
 net/llc/af_llc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/llc/af_llc.c +2 -2
index 8dab4e5..b3c52e3 100644
@@ -38,7 +38,7 @@ static u16 llc_ui_sap_link_no_max[256];
 static struct sockaddr_llc llc_ui_addrnull;
 static const struct proto_ops llc_ui_ops;
 
-static int llc_ui_wait_for_conn(struct sock *sk, long timeout);
+static long llc_ui_wait_for_conn(struct sock *sk, long timeout);
 static int llc_ui_wait_for_disc(struct sock *sk, long timeout);
 static int llc_ui_wait_for_busy_core(struct sock *sk, long timeout);
 
@@ -551,7 +551,7 @@ static int llc_ui_wait_for_disc(struct sock *sk, long timeout)
 	return rc;
 }
 
-static int llc_ui_wait_for_conn(struct sock *sk, long timeout)
+static long llc_ui_wait_for_conn(struct sock *sk, long timeout)
 {
 	DEFINE_WAIT(wait);
 
#1 lore raw
Quoted 2 lines · Alan

The timeout is a long, we return it truncated if it is huge. Basically harmless as the only caller does a boolean check, but tidy it up anyway.

If the only caller performs a boolean check then perhaps it would be best if the function's return type was bool.

Quoted 30 lines

(64bit build tested this time. Thank you 0day)

---
 net/llc/af_llc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/llc/af_llc.c +2 -2
index 8dab4e5..b3c52e3 100644
@@ -38,7 +38,7 @@ static u16 llc_ui_sap_link_no_max[256];
 static struct sockaddr_llc llc_ui_addrnull;
 static const struct proto_ops llc_ui_ops;
 
-static int llc_ui_wait_for_conn(struct sock *sk, long timeout);
+static long llc_ui_wait_for_conn(struct sock *sk, long timeout);
 static int llc_ui_wait_for_disc(struct sock *sk, long timeout);
 static int llc_ui_wait_for_busy_core(struct sock *sk, long timeout);
 
@@ -551,7 +551,7 @@ static int llc_ui_wait_for_disc(struct sock *sk, long timeout)
 	return rc;
 }
 
-static int llc_ui_wait_for_conn(struct sock *sk, long timeout)
+static long llc_ui_wait_for_conn(struct sock *sk, long timeout)
 {
 	DEFINE_WAIT(wait);
 
maintainer Applied
#2 lore raw
In reply to Alan

From: Alan <[email protected]>
Date: Mon, 15 Feb 2016 19:41:51 +0000

Quoted 6 lines

The timeout is a long, we return it truncated if it is huge. Basically harmless as the only caller does a boolean check, but tidy it up anyway.

(64bit build tested this time. Thank you 0day)

Applied, thanks Alan.

Please take into consideration Simon's idea to change the return type to bool as a follow-up.

Thanks.