All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] cls_flow: remove one dynamic array
@ 2011-12-14 12:30 Eric Dumazet
  2011-12-14 18:35 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2011-12-14 12:30 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Its better to use a predefined size for this small automatic variable.

Removes a sparse error as well :

net/sched/cls_flow.c:288:13: error: bad constant expression

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 net/sched/cls_flow.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c
index 51ff194..1d8bd0d 100644
--- a/net/sched/cls_flow.c
+++ b/net/sched/cls_flow.c
@@ -285,7 +285,7 @@ static int flow_classify(struct sk_buff *skb, const struct tcf_proto *tp,
 	int r;
 
 	list_for_each_entry(f, &head->filters, list) {
-		u32 keys[f->nkeys];
+		u32 keys[FLOW_KEY_MAX + 1];
 		struct flow_keys flow_keys;
 
 		if (!tcf_em_tree_match(skb, &f->ematches, NULL))

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

* Re: [PATCH net-next] cls_flow: remove one dynamic array
  2011-12-14 12:30 [PATCH net-next] cls_flow: remove one dynamic array Eric Dumazet
@ 2011-12-14 18:35 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-12-14 18:35 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 14 Dec 2011 13:30:00 +0100

> Its better to use a predefined size for this small automatic variable.
> 
> Removes a sparse error as well :
> 
> net/sched/cls_flow.c:288:13: error: bad constant expression
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied.

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

end of thread, other threads:[~2011-12-14 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-14 12:30 [PATCH net-next] cls_flow: remove one dynamic array Eric Dumazet
2011-12-14 18:35 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.