linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] __poll_t regressions this cycle
@ 2018-06-18 13:47 Al Viro
  2018-06-20  1:57 ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2018-06-18 13:47 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

	Some misannotations cropped up in this cycle's merges;
the fixes are trivial.  Do you prefer it in one commit, or
split into per-driver pieces?

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 95283f3bb51c..7fbb86215809 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -4412,7 +4412,7 @@ static __poll_t binder_poll(struct file *filp,
 
 	thread = binder_get_thread(proc);
 	if (!thread)
-		return POLLERR;
+		return EPOLLERR;
 
 	binder_inner_proc_lock(thread->proc);
 	thread->looper |= BINDER_LOOPER_STATE_POLL;
diff --git a/drivers/char/random.c b/drivers/char/random.c
index a8fb0020ba5c..a7b9be0c7c7e 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -722,7 +722,7 @@ static void credit_entropy_bits(struct entropy_store *r, int nbits)
 		/* should we wake readers? */
 		if (entropy_bits >= random_read_wakeup_bits &&
 		    wq_has_sleeper(&random_wait)) {
-			wake_up_interruptible_poll(&random_wait, POLLIN);
+			wake_up_interruptible_poll(&random_wait, EPOLLIN);
 			kill_fasync(&fasync, SIGIO, POLL_IN);
 		}
 		/* If the input pool is getting full, send some
@@ -1396,7 +1396,7 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min,
 	trace_debit_entropy(r->name, 8 * ibytes);
 	if (ibytes &&
 	    (r->entropy_count >> ENTROPY_SHIFT) < random_write_wakeup_bits) {
-		wake_up_interruptible_poll(&random_wait, POLLOUT);
+		wake_up_interruptible_poll(&random_wait, EPOLLOUT);
 		kill_fasync(&fasync, SIGIO, POLL_OUT);
 	}
 
diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c
index 9f8312137cad..7763c55f355d 100644
--- a/drivers/gpu/drm/drm_debugfs_crc.c
+++ b/drivers/gpu/drm/drm_debugfs_crc.c
@@ -307,17 +307,17 @@ static ssize_t crtc_crc_read(struct file *filep, char __user *user_buf,
 	return LINE_LEN(crc->values_cnt);
 }
 
-static unsigned int crtc_crc_poll(struct file *file, poll_table *wait)
+static __poll_t crtc_crc_poll(struct file *file, poll_table *wait)
 {
 	struct drm_crtc *crtc = file->f_inode->i_private;
 	struct drm_crtc_crc *crc = &crtc->crc;
-	unsigned ret;
+	__poll_t ret;
 
 	poll_wait(file, &crc->wq, wait);
 
 	spin_lock_irq(&crc->lock);
 	if (crc->source && crtc_crc_data_count(crc))
-		ret = POLLIN | POLLRDNORM;
+		ret = EPOLLIN | EPOLLRDNORM;
 	else
 		ret = 0;
 	spin_unlock_irq(&crc->lock);
diff --git a/drivers/misc/ibmvmc.c b/drivers/misc/ibmvmc.c
index fb83d1375638..5efef9f6e76d 100644
--- a/drivers/misc/ibmvmc.c
+++ b/drivers/misc/ibmvmc.c
@@ -999,11 +999,11 @@ static ssize_t ibmvmc_read(struct file *file, char *buf, size_t nbytes,
  * Return:
  *	poll.h return values
  */
-static unsigned int ibmvmc_poll(struct file *file, poll_table *wait)
+static __poll_t ibmvmc_poll(struct file *file, poll_table *wait)
 {
 	struct ibmvmc_file_session *session;
 	struct ibmvmc_hmc *hmc;
-	unsigned int mask = 0;
+	__poll_t mask = 0;
 
 	session = file->private_data;
 	if (!session)
@@ -1016,7 +1016,7 @@ static unsigned int ibmvmc_poll(struct file *file, poll_table *wait)
 	poll_wait(file, &ibmvmc_read_wait, wait);
 
 	if (hmc->queue_head != hmc->queue_tail)
-		mask |= POLLIN | POLLRDNORM;
+		mask |= EPOLLIN | EPOLLRDNORM;
 
 	return mask;
 }
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
index 7465f17e1559..826e7e1fc34f 100644
--- a/drivers/misc/mei/main.c
+++ b/drivers/misc/mei/main.c
@@ -600,10 +600,10 @@ static __poll_t mei_poll(struct file *file, poll_table *wait)
 			mei_cl_read_start(cl, mei_cl_mtu(cl), file);
 	}
 
-	if (req_events & (POLLOUT | POLLWRNORM)) {
+	if (req_events & (EPOLLOUT | EPOLLWRNORM)) {
 		poll_wait(file, &cl->tx_wait, wait);
 		if (cl->tx_cb_queued < dev->tx_queue_limit)
-			mask |= POLLOUT | POLLWRNORM;
+			mask |= EPOLLOUT | EPOLLWRNORM;
 	}
 
 out:
diff --git a/drivers/scsi/cxlflash/ocxl_hw.c b/drivers/scsi/cxlflash/ocxl_hw.c
index 0a95b5f25380..1b6198e5a565 100644
--- a/drivers/scsi/cxlflash/ocxl_hw.c
+++ b/drivers/scsi/cxlflash/ocxl_hw.c
@@ -1015,20 +1015,20 @@ static inline bool ctx_event_pending(struct ocxlflash_context *ctx)
  *
  * Return: poll mask
  */
-static unsigned int afu_poll(struct file *file, struct poll_table_struct *poll)
+static __poll_t afu_poll(struct file *file, struct poll_table_struct *poll)
 {
 	struct ocxlflash_context *ctx = file->private_data;
 	struct device *dev = ctx->hw_afu->dev;
 	ulong lock_flags;
-	int mask = 0;
+	__poll_t mask = 0;
 
 	poll_wait(file, &ctx->wq, poll);
 
 	spin_lock_irqsave(&ctx->slock, lock_flags);
 	if (ctx_event_pending(ctx))
-		mask |= POLLIN | POLLRDNORM;
+		mask |= EPOLLIN | EPOLLRDNORM;
 	else if (ctx->state == CLOSED)
-		mask |= POLLERR;
+		mask |= EPOLLERR;
 	spin_unlock_irqrestore(&ctx->slock, lock_flags);
 
 	dev_dbg(dev, "%s: Poll wait completed for pe %i mask %i\n",
diff --git a/fs/select.c b/fs/select.c
index 317891ff8165..1335288ed67a 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -39,7 +39,7 @@ __poll_t vfs_poll(struct file *file, struct poll_table_struct *pt)
 	if (file->f_op->poll) {
 		return file->f_op->poll(file, pt);
 	} else if (file_has_poll_mask(file)) {
-		unsigned int events = poll_requested_events(pt);
+		__poll_t events = poll_requested_events(pt);
 		struct wait_queue_head *head;
 
 		if (pt && pt->_qproc) {
diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
index ab751a150f70..1c5f9693af4c 100644
--- a/net/rds/af_rds.c
+++ b/net/rds/af_rds.c
@@ -185,7 +185,7 @@ static __poll_t rds_poll(struct file *file, struct socket *sock,
 	if (rs->rs_snd_bytes < rds_sk_sndbuf(rs))
 		mask |= (EPOLLOUT | EPOLLWRNORM);
 	if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
-		mask |= POLLERR;
+		mask |= EPOLLERR;
 	read_unlock_irqrestore(&rs->rs_recv_lock, flags);
 
 	/* clear state any time we wake a seen-congested socket */
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 36919a254ba3..82d321b8e61b 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -307,9 +307,9 @@ static __poll_t xsk_poll_mask(struct socket *sock, __poll_t events)
 	struct xdp_sock *xs = xdp_sk(sk);
 
 	if (xs->rx && !xskq_empty_desc(xs->rx))
-		mask |= POLLIN | POLLRDNORM;
+		mask |= EPOLLIN | EPOLLRDNORM;
 	if (xs->tx && !xskq_full_desc(xs->tx))
-		mask |= POLLOUT | POLLWRNORM;
+		mask |= EPOLLOUT | EPOLLWRNORM;
 
 	return mask;
 }

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

* Re: [PATCH] __poll_t regressions this cycle
  2018-06-18 13:47 [PATCH] __poll_t regressions this cycle Al Viro
@ 2018-06-20  1:57 ` Linus Torvalds
  2018-06-20  3:33   ` Al Viro
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 2018-06-20  1:57 UTC (permalink / raw)
  To: Al Viro; +Cc: Linux Kernel Mailing List

On Mon, Jun 18, 2018 at 10:47 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> Do you prefer it in one commit, or split into per-driver pieces?

If it's all the exact same issue with the same commit message, then
just one commit.

                Linus

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

* Re: [PATCH] __poll_t regressions this cycle
  2018-06-20  1:57 ` Linus Torvalds
@ 2018-06-20  3:33   ` Al Viro
  0 siblings, 0 replies; 3+ messages in thread
From: Al Viro @ 2018-06-20  3:33 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel Mailing List

On Wed, Jun 20, 2018 at 10:57:41AM +0900, Linus Torvalds wrote:
> On Mon, Jun 18, 2018 at 10:47 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
> >
> > Do you prefer it in one commit, or split into per-driver pieces?
> 
> If it's all the exact same issue with the same commit message, then
> just one commit.

Some EPOLL... misspelled as POLL..., some ->poll() instances declared
as returning unsigned int instead of __poll_t and some __poll_t local
variables declared unsigned int.  The only case beyond misannotations
is POLLWRNORM instead of EPOLLWRNORM - basically, on sparc, mips et.al. 
EPOLLWRNORM (via epoll(7)) doesn't trigger for mei and xsk.  Which
used to be the case for all drivers (only EPOLLOUT used to trigger on
these architectures) before the fixes this February...

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

end of thread, other threads:[~2018-06-20  3:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18 13:47 [PATCH] __poll_t regressions this cycle Al Viro
2018-06-20  1:57 ` Linus Torvalds
2018-06-20  3:33   ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).