summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2015-10-13 15:56:03 +0200
committerTobias Klauser <tklauser@distanz.ch>2015-10-13 15:56:03 +0200
commitdaac1198c011aa122cf52004629dd77b4e99ae7d (patch)
tree06fb0b6fdb82728d462e82b9018fe12ca0eae226
parentadb9677639193700ed7777f1ee085fa7539f8d90 (diff)
trafgen: Make xmit_packet_precheck() return void
The return value of xmit_packet_precheck() is always 0 and it calls panic() in any error cases, so its return value isn't of any use. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--trafgen.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/trafgen.c b/trafgen.c
index 71e4f3a..800ba02 100644
--- a/trafgen.c
+++ b/trafgen.c
@@ -777,7 +777,7 @@ static void __set_state_cd(unsigned int cpu, unsigned long p, sig_atomic_t s)
stats[cpu].state = s;
}
-static int xmit_packet_precheck(struct ctx *ctx, unsigned int cpu)
+static void xmit_packet_precheck(struct ctx *ctx, unsigned int cpu)
{
unsigned int i;
unsigned long plen_total, orig = ctx->num;
@@ -801,7 +801,7 @@ static int xmit_packet_precheck(struct ctx *ctx, unsigned int cpu)
if (plen == 0) {
__set_state(cpu, CPU_STATS_STATE_RES);
- return 0;
+ return;
}
for (mtu = device_mtu(ctx->device), i = 0; i < plen; ++i) {
@@ -811,16 +811,13 @@ static int xmit_packet_precheck(struct ctx *ctx, unsigned int cpu)
panic("Packet%d's size must be > %d bytes!\n",
i, PKT_MIN_LEN);
}
-
- return 0;
}
static void main_loop(struct ctx *ctx, char *confname, bool slow,
unsigned int cpu, bool invoke_cpp, unsigned long orig_num)
{
compile_packets(confname, ctx->verbose, cpu, invoke_cpp);
- if (xmit_packet_precheck(ctx, cpu) < 0)
- return;
+ xmit_packet_precheck(ctx, cpu);
if (cpu == 0) {
unsigned int i;