diff mbox

[v3,net-next,3/4] net: change sysctl_net_ll_poll into an unsigned int

Message ID 20130613144645.4875.47741.stgit@ladj378.jer.intel.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Eliezer Tamir June 13, 2013, 2:46 p.m. UTC
There is no reason for sysctl_net_ll_poll to be an unsigned long.
Change it into an unsigned int.
Fix the proc handler.

Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
---

 include/net/ll_poll.h      |    2 +-
 net/core/sysctl_net_core.c |    4 ++--
 net/socket.c               |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Eric Dumazet June 13, 2013, 3:31 p.m. UTC | #1
On Thu, 2013-06-13 at 17:46 +0300, Eliezer Tamir wrote:
> There is no reason for sysctl_net_ll_poll to be an unsigned long.
> Change it into an unsigned int.
> Fix the proc handler.
> 
> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
> ---
> 
>  include/net/ll_poll.h      |    2 +-
>  net/core/sysctl_net_core.c |    4 ++--
>  net/socket.c               |    2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/include/net/ll_poll.h b/include/net/ll_poll.h
> index c75a611..9f7007f 100644
> --- a/include/net/ll_poll.h
> +++ b/include/net/ll_poll.h
> @@ -30,7 +30,7 @@
>  #ifdef CONFIG_NET_LL_RX_POLL
>  
>  struct napi_struct;
> -extern unsigned long sysctl_net_ll_poll __read_mostly;
> +extern unsigned int sysctl_net_ll_poll __read_mostly;
>  

Oh well, you re-introduce the overflow

hint : you defined 

#define USECS_TO_NS(us) (us << 10)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eliezer Tamir June 13, 2013, 3:36 p.m. UTC | #2
On 13/06/2013 18:31, Eric Dumazet wrote:
> On Thu, 2013-06-13 at 17:46 +0300, Eliezer Tamir wrote:
>> +extern unsigned int sysctl_net_ll_poll __read_mostly;
>>
>
> Oh well, you re-introduce the overflow
>
> hint : you defined
>
> #define USECS_TO_NS(us) (us << 10)

ouch!
(thanks)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/net/ll_poll.h b/include/net/ll_poll.h
index c75a611..9f7007f 100644
--- a/include/net/ll_poll.h
+++ b/include/net/ll_poll.h
@@ -30,7 +30,7 @@ 
 #ifdef CONFIG_NET_LL_RX_POLL
 
 struct napi_struct;
-extern unsigned long sysctl_net_ll_poll __read_mostly;
+extern unsigned int sysctl_net_ll_poll __read_mostly;
 
 /* return values from ndo_ll_poll */
 #define LL_FLUSH_FAILED		-1
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 637a42e..ce9acc2 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -289,9 +289,9 @@  static struct ctl_table net_core_table[] = {
 	{
 		.procname	= "low_latency_poll",
 		.data		= &sysctl_net_ll_poll,
-		.maxlen		= sizeof(unsigned long),
+		.maxlen		= sizeof(unsigned int),
 		.mode		= 0644,
-		.proc_handler	= proc_doulongvec_minmax
+		.proc_handler	= proc_dointvec
 	},
 #endif
 #endif /* CONFIG_NET */
diff --git a/net/socket.c b/net/socket.c
index 21fd29f..caaffa1 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -107,7 +107,7 @@ 
 #include <net/ll_poll.h>
 
 #ifdef CONFIG_NET_LL_RX_POLL
-unsigned long sysctl_net_ll_poll __read_mostly;
+unsigned int sysctl_net_ll_poll __read_mostly;
 EXPORT_SYMBOL_GPL(sysctl_net_ll_poll);
 #endif