netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2] af_llc: fix types on llc_ui_wait_for_conn
@ 2016-02-15 19:41 Alan
  2016-02-16  3:04 ` Simon Horman
  2016-02-17 21:12 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Alan @ 2016-02-15 19:41 UTC (permalink / raw)
  To: netdev

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)

Signed-off-by: Alan Cox <alan@linux.intel.com>
---
 net/llc/af_llc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 8dab4e5..b3c52e3 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -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);
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCHv2] af_llc: fix types on llc_ui_wait_for_conn
  2016-02-15 19:41 [PATCHv2] af_llc: fix types on llc_ui_wait_for_conn Alan
@ 2016-02-16  3:04 ` Simon Horman
  2016-02-17 21:12 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2016-02-16  3:04 UTC (permalink / raw)
  To: Alan; +Cc: netdev

On Mon, Feb 15, 2016 at 07:41:51PM +0000, Alan wrote:
> 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.

> (64bit build tested this time. Thank you 0day)
> 
> Signed-off-by: Alan Cox <alan@linux.intel.com>
> ---
>  net/llc/af_llc.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
> index 8dab4e5..b3c52e3 100644
> --- a/net/llc/af_llc.c
> +++ b/net/llc/af_llc.c
> @@ -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);
>  
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCHv2] af_llc: fix types on llc_ui_wait_for_conn
  2016-02-15 19:41 [PATCHv2] af_llc: fix types on llc_ui_wait_for_conn Alan
  2016-02-16  3:04 ` Simon Horman
@ 2016-02-17 21:12 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-02-17 21:12 UTC (permalink / raw)
  To: gnomes; +Cc: netdev

From: Alan <gnomes@lxorguk.ukuu.org.uk>
Date: Mon, 15 Feb 2016 19:41:51 +0000

> 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)
> 
> Signed-off-by: Alan Cox <alan@linux.intel.com>

Applied, thanks Alan.

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

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-17 21:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-15 19:41 [PATCHv2] af_llc: fix types on llc_ui_wait_for_conn Alan
2016-02-16  3:04 ` Simon Horman
2016-02-17 21:12 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).