Skip to content

Commit

Permalink
x25: remove redundant pointer dev
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
ColinIanKing authored and Paolo Abeni committed May 10, 2022
1 parent a12af6f commit ecd17a8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/x25/x25_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ static int x25_seq_socket_show(struct seq_file *seq, void *v)
{
struct sock *s;
struct x25_sock *x25;
struct net_device *dev;
const char *devname;

if (v == SEQ_START_TOKEN) {
Expand All @@ -91,7 +90,7 @@ static int x25_seq_socket_show(struct seq_file *seq, void *v)
s = sk_entry(v);
x25 = x25_sk(s);

if (!x25->neighbour || (dev = x25->neighbour->dev) == NULL)
if (!x25->neighbour || !x25->neighbour->dev)
devname = "???";
else
devname = x25->neighbour->dev->name;
Expand Down

0 comments on commit ecd17a8

Please sign in to comment.