[PATCH net-next v4 11/17] net: pktgen: remove some superfluous variable initializing

Peter Seiderer
2025-02-05T13:12:11Z

Remove some superfluous variable initializing before hex32_arg call (as the
same init is done here already).

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v3 -> v4
- new patch (factored out of patch 'net: pktgen: fix access outside of user
given buffer in pktgen_if_write()')
---
net/core/pktgen.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 91b06473c925..84fd88e48275 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -1792,7 +1792,7 @@ static ssize_t pktgen_if_write(struct file *file,
}

if (!strcmp(name, "tos")) {
- __u32 tmp_value = 0;
+ __u32 tmp_value;
len = hex32_arg(&user_buffer[i], HEX_2_DIGITS, &tmp_value);
if (len < 0)
return len;
@@ -1808,7 +1808,7 @@ static ssize_t pktgen_if_write(struct file *file,
}

if (!strcmp(name, "traffic_class")) {
- __u32 tmp_value = 0;
+ __u32 tmp_value;
len = hex32_arg(&user_buffer[i], HEX_2_DIGITS, &tmp_value);
if (len < 0)
return len;
--
2.48.1