Skip to content

Commit

Permalink
net: pktgen: remove extra tmp variable (re-use len instead)
Browse files Browse the repository at this point in the history
Remove extra tmp variable in pktgen_if_write (re-use len instead).

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Peter Seiderer authored and Paolo Abeni committed Mar 4, 2025
1 parent 90b856a commit 7d39e01
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,6 @@ static ssize_t pktgen_if_write(struct file *file,
char name[16], valstr[32];
unsigned long value = 0;
char *pg_result = NULL;
int tmp = 0;
char buf[128];

pg_result = &(pkt_dev->result[0]);
Expand All @@ -970,12 +969,12 @@ static ssize_t pktgen_if_write(struct file *file,
}

max = count;
tmp = count_trail_chars(user_buffer, max);
if (tmp < 0) {
len = count_trail_chars(user_buffer, max);
if (len < 0) {
pr_warn("illegal format\n");
return tmp;
return len;
}
i = tmp;
i = len;

/* Read variable name */

Expand Down

0 comments on commit 7d39e01

Please sign in to comment.