Skip to contentSkip to conversation

net: rxrpc: Remove redundant assignment to ret

PATCH New Yang Li 1 participant 1 message Apr 29, 2021

Subsystems (3)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 net: rxrpc: Remove redundant assignment to ret

Variable 'ret' is set to -EOPNOTSUPP but this value is never read as it is overwritten with a new value later on, hence it is a redundant assignment and can be removed.

Clean up the following clang-analyzer warning:

net/rxrpc/af_rxrpc.c:602:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]

---
 net/rxrpc/af_rxrpc.c | 1 -
 1 file changed, 1 deletion(-)
net/rxrpc/af_rxrpc.c +0 -1
index 41671af..f2d81c5 100644
@@ -599,7 +599,6 @@ static int rxrpc_setsockopt(struct socket *sock, int level, int optname,
 	_enter(",%d,%d,,%d", level, optname, optlen);
 
 	lock_sock(&rx->sk);
-	ret = -EOPNOTSUPP;
 
 	if (level == SOL_RXRPC) {
 		switch (optname) {
Signature · 1 line
1.8.3.1