Skip to content

Commit 11d2681

Browse files
committed
Merge branch 'selftests-net-Fix-clang-warnings-on-powerpc'
Tanner Love says: ==================== selftests/net: Fix clang warnings on powerpc This is essentially a v2 of http://patchwork.ozlabs.org/project/netdev/patch/[email protected]/, but it has been split up in order to have only one "Fixes" tag per patch. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 5fd8220 + 94b6c13 commit 11d2681

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

tools/testing/selftests/net/psock_fanout.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,8 @@ static int test_datapath(uint16_t typeflags, int port_off,
350350
int fds[2], fds_udp[2][2], ret;
351351

352352
fprintf(stderr, "\ntest: datapath 0x%hx ports %hu,%hu\n",
353-
typeflags, PORT_BASE, PORT_BASE + port_off);
353+
typeflags, (uint16_t)PORT_BASE,
354+
(uint16_t)(PORT_BASE + port_off));
354355

355356
fds[0] = sock_fanout_open(typeflags, 0);
356357
fds[1] = sock_fanout_open(typeflags, 0);

tools/testing/selftests/net/rxtimestamp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,7 @@ int main(int argc, char **argv)
329329
bool all_tests = true;
330330
int arg_index = 0;
331331
int failures = 0;
332-
int s, t;
333-
char opt;
332+
int s, t, opt;
334333

335334
while ((opt = getopt_long(argc, argv, "", long_options,
336335
&arg_index)) != -1) {

tools/testing/selftests/net/so_txtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static bool do_recv_one(int fdr, struct timed_send *ts)
121121
if (rbuf[0] != ts->data)
122122
error(1, 0, "payload mismatch. expected %c", ts->data);
123123

124-
if (labs(tstop - texpect) > cfg_variance_us)
124+
if (llabs(tstop - texpect) > cfg_variance_us)
125125
error(1, 0, "exceeds variance (%d us)", cfg_variance_us);
126126

127127
return false;

tools/testing/selftests/net/tcp_mmap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ int main(int argc, char *argv[])
344344
{
345345
struct sockaddr_storage listenaddr, addr;
346346
unsigned int max_pacing_rate = 0;
347-
size_t total = 0;
347+
uint64_t total = 0;
348348
char *host = NULL;
349349
int fd, c, on = 1;
350350
char *buffer;
@@ -473,12 +473,12 @@ int main(int argc, char *argv[])
473473
zflg = 0;
474474
}
475475
while (total < FILE_SZ) {
476-
ssize_t wr = FILE_SZ - total;
476+
int64_t wr = FILE_SZ - total;
477477

478478
if (wr > chunk_size)
479479
wr = chunk_size;
480480
/* Note : we just want to fill the pipe with 0 bytes */
481-
wr = send(fd, buffer, wr, zflg ? MSG_ZEROCOPY : 0);
481+
wr = send(fd, buffer, (size_t)wr, zflg ? MSG_ZEROCOPY : 0);
482482
if (wr <= 0)
483483
break;
484484
total += wr;

0 commit comments

Comments
 (0)