Thread (3 messages) flat view 3 messages, 2 authors, 2017-03-20

Re: [PATCH 2/4] flowcache: make flow_cache_hash_size() return "unsigned int"

From: Eric Dumazet <hidden>
Date: 2017-03-19 23:13:44

On Mon, 2017-03-20 at 01:24 +0300, Alexey Dobriyan wrote:
Hash size can't negative so "unsigned int" is logically correct.
 	struct flow_cache_percpu *fcp = per_cpu_ptr(fc->percpu, cpu);
-	size_t sz = sizeof(struct hlist_head) * flow_cache_hash_size(fc);
+	unsigned int sz = sizeof(struct hlist_head) * flow_cache_hash_size(fc);
 
 	if (!fcp->hash_table) {
 		fcp->hash_table = kzalloc_node(sz, GFP_KERNEL, cpu_to_node(cpu));
 		if (!fcp->hash_table) {
-			pr_err("NET: failed to allocate flow cache sz %zu\n", sz);
+			pr_err("NET: failed to allocate flow cache sz %u\n", sz);

I do not see any improvement here.

What is wrong with size_t exactly ?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help