ipv6: recompute the array size
Subsystems (3)
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
Signed-off-by Li RongQing <[email protected]>
--- net/ipv6/xfrm6_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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);for (i =0 ; i < n; i++) {int c;
Signature · 1 line
1.7.10.4
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 expressionSigned-off-by Li RongQing <[email protected]>--- net/ipv6/xfrm6_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/ipv6/xfrm6_state.c +0
-0
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
Quoted 4 lines · On Fri, Apr 04, 2014 at 02:51:26PM +0800, [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
It is a sparse warning, no? sizeof in gcc has no problems with variable length arrays.
Greetings,
Hannes