Linux-Fsdevel Archive on lore.kernel.org
 help / Atom feed
* [PATCH v1] fcntl: Remove logically dead code
@ 2019-02-11 13:43 Stanley Chu
  0 siblings, 0 replies; 1+ messages in thread
From: Stanley Chu @ 2019-02-11 13:43 UTC (permalink / raw)
  To: linux-fsdevel, viro
  Cc: jlayton, bfields, wsd_upstream, linux-mediatek, kuohong.wang,
	Stanley Chu

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.

Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
---
 fs/fcntl.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/fcntl.c b/fs/fcntl.c
index 083185174c6d..11ec59bf421c 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -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;
-- 
2.18.0


^ permalink raw reply	[flat|nested] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-11 13:43 [PATCH v1] fcntl: Remove logically dead code Stanley Chu

Linux-Fsdevel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-fsdevel/0 linux-fsdevel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-fsdevel linux-fsdevel/ https://lore.kernel.org/linux-fsdevel \
		linux-fsdevel@vger.kernel.org linux-fsdevel@archiver.kernel.org
	public-inbox-index linux-fsdevel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-fsdevel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox