Skip to contentSkip to conversation

fcntl: Remove logically dead code

PATCH New Stanley Chu 1 participant 1 message Feb 11, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fcntl: Remove logically dead code

The commit d08477aa975e ("fcntl: Don't use ambiguous SIG_POLL si_codes") added BUG_ON for below case,

(reason - POLL_IN) >= NSIGPOLL

Thus some statements become logically dead code and can be removed.

---
 fs/fcntl.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
fs/fcntl.c +1 -4
index 083185174c6d..11ec59bf421c 100644
@@ -762,10 +762,7 @@ static void send_sigio_to_task(struct task_struct *p,
 			   reasons, otherwise we could leak kernel stack into
 			   userspace.  */
 			BUG_ON((reason < POLL_IN) || ((reason - POLL_IN) >= NSIGPOLL));
-			if (reason - POLL_IN >= NSIGPOLL)
-				si.si_band  = ~0L;
-			else
-				si.si_band = mangle_poll(band_table[reason - POLL_IN]);
+			si.si_band = mangle_poll(band_table[reason - POLL_IN]);
 			si.si_fd    = fd;
 			if (!do_send_sig_info(signum, &si, p, type))
 				break;
Signature · 1 line
2.18.0