netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ipv6: recompute the array size
@ 2014-04-04  6:51 roy.qing.li
  2014-04-04 12:34 ` Sergei Shtylyov
  2014-04-04 12:52 ` Hannes Frederic Sowa
  0 siblings, 2 replies; 3+ messages in thread
From: roy.qing.li @ 2014-04-04  6:51 UTC (permalink / raw)
  To: netdev

From: Li RongQing <roy.qing.li@gmail.com>

recompute the array size to kill the warning:
 net/ipv6/xfrm6_state.c:66:26: error: cannot size expression

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 net/ipv6/xfrm6_state.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c
index 3fc9701..9e08572 100644
--- a/net/ipv6/xfrm6_state.c
+++ b/net/ipv6/xfrm6_state.c
@@ -63,7 +63,7 @@ __xfrm6_sort(void **dst, void **src, int n, int (*cmp)(void *p), int maxclass)
 	int class[XFRM_MAX_DEPTH];
 	int count[maxclass];
 
-	memset(count, 0, sizeof(count));
+	memset(count, 0, sizeof(int)*maxclass);
 
 	for (i = 0; i < n; i++) {
 		int c;
-- 
1.7.10.4

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

* Re: [PATCH net-next] ipv6: recompute the array size
  2014-04-04  6:51 [PATCH net-next] ipv6: recompute the array size roy.qing.li
@ 2014-04-04 12:34 ` Sergei Shtylyov
  2014-04-04 12:52 ` Hannes Frederic Sowa
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2014-04-04 12:34 UTC (permalink / raw)
  To: roy.qing.li, netdev

Hello.

On 04-04-2014 10:51, roy.qing.li@gmail.com wrote:

> From: Li RongQing <roy.qing.li@gmail.com>

> recompute the array size to kill the warning:
>   net/ipv6/xfrm6_state.c:66:26: error: cannot size expression

> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
> ---
>   net/ipv6/xfrm6_state.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c
> index 3fc9701..9e08572 100644
> --- a/net/ipv6/xfrm6_state.c
> +++ b/net/ipv6/xfrm6_state.c
> @@ -63,7 +63,7 @@ __xfrm6_sort(void **dst, void **src, int n, int (*cmp)(void *p), int maxclass)
>   	int class[XFRM_MAX_DEPTH];
>   	int count[maxclass];
>
> -	memset(count, 0, sizeof(count));
> +	memset(count, 0, sizeof(int)*maxclass);

    Please insert spaces before and after *.

WBR, Sergei

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

* Re: [PATCH net-next] ipv6: recompute the array size
  2014-04-04  6:51 [PATCH net-next] ipv6: recompute the array size roy.qing.li
  2014-04-04 12:34 ` Sergei Shtylyov
@ 2014-04-04 12:52 ` Hannes Frederic Sowa
  1 sibling, 0 replies; 3+ messages in thread
From: Hannes Frederic Sowa @ 2014-04-04 12:52 UTC (permalink / raw)
  To: roy.qing.li; +Cc: netdev

On Fri, Apr 04, 2014 at 02:51:26PM +0800, roy.qing.li@gmail.com wrote:
> From: Li RongQing <roy.qing.li@gmail.com>
> 
> recompute the array size to kill the warning:
>  net/ipv6/xfrm6_state.c:66:26: error: cannot size expression

It is a sparse warning, no? sizeof in gcc has no problems with variable length
arrays.

Greetings,

  Hannes

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

end of thread, other threads:[~2014-04-04 12:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-04  6:51 [PATCH net-next] ipv6: recompute the array size roy.qing.li
2014-04-04 12:34 ` Sergei Shtylyov
2014-04-04 12:52 ` Hannes Frederic Sowa

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).