Skip to contentSkip to conversation

ipv6: recompute the array size

PATCH In review [email protected] 3 participants 3 messages Apr 4, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: recompute the array size

From: Li RongQing <[email protected]>

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

---
 net/ipv6/xfrm6_state.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/xfrm6_state.c +1 -1
index 3fc9701..9e08572 100644
@@ -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;
Signature · 1 line
1.7.10.4
#1 lore raw

Hello.

Quoted 15 lines · On 04-04-2014 10:51, [email protected] wrote:

From: Li RongQing <[email protected]>

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

---
  net/ipv6/xfrm6_state.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/xfrm6_state.c +0 -0
index 3fc9701..9e08572 100644

net/ipv6/xfrm6_state.c __xfrm6_sort(void **dst, void **src, int n, int (*cmp)(void *p), int maxclass) · line 66

Quoted 5 lines
net/ipv6/xfrm6_state.c +1 -1
@@ -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