net: replace min with min_t in pktgen_if_write
Subsystems (2)
PATCH 1/1 net: replace min with min_t in pktgen_if_write
From: Davidlohr Bueso <[email protected]>
This addresses the following compiler (gcc 4.4.5) warning:
CC [M] net/core/pktgen.onet/core/pktgen.c: In function ‘pktgen_if_write’:net/core/pktgen.c:890: warning: comparison of distinct pointer types lacks a cast
--- net/core/pktgen.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/core/pktgen.c +1 -1
@@ -887,7 +887,7 @@ static ssize_t pktgen_if_write(struct file *file, i += len;if (debug) { -size_t copy =min (count,1023 ); +size_t copy =min_t (size_t, count,1023 );char tb[copy +1 ];if (copy_from_user (tb, user_buffer, copy))return -EFAULT ;
Signature · 1 line
1.7.1
From: Davidlohr Bueso <[email protected]>
Date: Tue, 09 Nov 2010 13:37:13 -0300
Quoted 9 lines
From: Davidlohr Bueso <[email protected]>
This addresses the following compiler (gcc 4.4.5) warning:
CC [M]
net/core/pktgen.onet/core/pktgen.c: In function ‘pktgen_if_write’:net/core/pktgen.c:890: warning: comparison of distinct pointer types lacks a castSigned-off-by Davidlohr Bueso <[email protected]>
Already fixed in net-2.6:
commit 86c2c0a8a4965ae5cbc0ff97ed39a4472e8e9b23
Author: Dmitry Torokhov <[email protected]> Date: Sat Nov 6 20:11:38 2010 +0000
NET: pktgen - fix compile warning
This should fix the following warning:
net/core/pktgen.c: In function ‘pktgen_if_write’:
net/core/pktgen.c:890: warning: comparison of distinct pointer types lacks a cast
net/core/pktgen.c +1 -1
@@ -887,7 +887,7 @@ static ssize_t pktgen_if_write(struct file *file, i += len;if (debug) { -size_t copy =min (count,1023 ); +size_t copy =min_t (size_t, count,1023 );char tb[copy +1 ];if (copy_from_user (tb, user_buffer, copy))return -EFAULT ;