Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x25: remove redundant pointer dev

Pointer dev is being assigned a value that is never used, the assignment
and the variable are redundant and can be removed. Also replace null check
with the preferred !ptr idiom.

Cleans up clang scan warning:
net/x25/x25_proc.c:94:26: warning: Although the value stored to 'dev' is
used in the enclosing expression, the value is never actually read
from 'dev' [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20220508214500.60446-1-colin.i.king@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Colin Ian King and committed by
Paolo Abeni
ecd17a87 a12af6f8

+1 -2
+1 -2
net/x25/x25_proc.c
··· 79 79 { 80 80 struct sock *s; 81 81 struct x25_sock *x25; 82 - struct net_device *dev; 83 82 const char *devname; 84 83 85 84 if (v == SEQ_START_TOKEN) { ··· 90 91 s = sk_entry(v); 91 92 x25 = x25_sk(s); 92 93 93 - if (!x25->neighbour || (dev = x25->neighbour->dev) == NULL) 94 + if (!x25->neighbour || !x25->neighbour->dev) 94 95 devname = "???"; 95 96 else 96 97 devname = x25->neighbour->dev->name;