Skip to contentSkip to conversation

staging: fieldbus: solve warning incorrect type dev_core.c

PATCH In review Oscar Gomez Fuente 3 participants 8 messages May 17, 2019 – May 21, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: fieldbus: solve warning incorrect type dev_core.c

These changes solve a warning realated to an incorrect type inilizer in the function fieldbus_poll.

---
 drivers/staging/fieldbus/dev_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/fieldbus/dev_core.c +3 -3
index 60b851406..f6f5b92 100644
@@ -211,16 +211,16 @@ static ssize_t fieldbus_write(struct file *filp, const char __user *buf,
 	return fbdev->write_area(fbdev, buf, size, offset);
 }
 
-static unsigned int fieldbus_poll(struct file *filp, poll_table *wait)
+static __poll_t fieldbus_poll(struct file *filp, poll_table *wait)
 {
 	struct fb_open_file *of = filp->private_data;
 	struct fieldbus_dev *fbdev = of->fbdev;
-	unsigned int mask = POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM;
+	__poll_t mask = EPOLLIN | EPOLLRDNORM | EPOLLOUT | EPOLLWRNORM;
 
 	poll_wait(filp, &fbdev->dc_wq, wait);
 	/* data changed ? */
 	if (fbdev->dc_event != of->dc_event)
-		mask |= POLLPRI | POLLERR;
+		mask |= EPOLLPRI | EPOLLERR;
 	return mask;
 }
 
Signature · 1 line
2.7.4
#1 lore raw

Hi Oscar, thank you for your contribution! I have a question, see inline.

Quoted 4 lines · Oscar Gomez Fuente

These changes solve a warning realated to an incorrect type inilizer in the function fieldbus_poll.

Where is this warning generated? Could you provide some brief instructions on how to reproduce this warning?

Thanks,
Sven

#2 lore raw
Quoted 9 lines · Sven Van Asbroeck

Hi Oscar, thank you for your contribution! I have a question, see inline.

Quoted 4 lines · Oscar Gomez Fuente

These changes solve a warning realated to an incorrect type inilizer in the function fieldbus_poll.

This warning was generated by sparse, right?

$ make C=2 drivers/staging/fieldbus/
<snip>
  CHECK   drivers/staging/fieldbus/dev_core.c
drivers/staging/fieldbus/dev_core.c:232:27: warning: incorrect type in
initializer (different base types)
drivers/staging/fieldbus/dev_core.c:232:27:    expected restricted
__poll_t ( *poll )( ... )
drivers/staging/fieldbus/dev_core.c:232:27:    got unsigned int (
*<noident> )( ... )
<snip>

I will test your patch on actual h/w, probably tomorrow. I don't expect to see any problems.

Sven

#3 lore raw

Hi Sven,

Yes.

Oscar Gomez Fuente

Óscar Gómez Fuente
Electronic Engineer & Degree in Physical Sciences
Mobile: 659.28.97.90
Email: [email protected]
Website: www.oscargomezf.com

Quoted 29 lines · Sven Van Asbroeck
Quoted 9 lines · Sven Van Asbroeck

Hi Oscar, thank you for your contribution! I have a question, see inline.

Quoted 4 lines · Oscar Gomez Fuente

These changes solve a warning realated to an incorrect type inilizer in the function fieldbus_poll.

This warning was generated by sparse, right?

$ make C=2 drivers/staging/fieldbus/
<snip>
  CHECK   drivers/staging/fieldbus/dev_core.c
drivers/staging/fieldbus/dev_core.c:232:27: warning: incorrect type in
initializer (different base types)
drivers/staging/fieldbus/dev_core.c:232:27:    expected restricted
__poll_t ( *poll )( ... )
drivers/staging/fieldbus/dev_core.c:232:27:    got unsigned int (
*<noident> )( ... )
<snip>

I will test your patch on actual h/w, probably tomorrow. I don't expect to see any problems.

Sven

#4 lore raw
In reply to Oscar Gomez Fuente
Quoted 6 lines · Oscar Gomez Fuente

These changes solve a warning realated to an incorrect type inilizer in the function fieldbus_poll.

---

I've reviewed your patch and tested it on a live system. Everything looks good. However, I believe that your commit message could be improved.

I am going to re-post this patch as v3 (keeping you as the author) but with a (hopefully) improved commit message. If you provide positive feedback, and nobody else has any comments, I will tag it with my Reviewed-by, which will hopefully be Greg's cue to take the patch.

In the future you could perhaps run your patch through ./scripts/checkpatch.pl before you post it? This should pick up missing commit messages, lines in the commit msg that are too long, etc.

maintainer
#5 lore raw
Quoted 9 lines · Sven Van Asbroeck
Quoted 6 lines · Oscar Gomez Fuente

These changes solve a warning realated to an incorrect type inilizer in the function fieldbus_poll.

---

Quoted 7 lines

I've reviewed your patch and tested it on a live system. Everything looks good. However, I believe that your commit message could be improved.

I am going to re-post this patch as v3 (keeping you as the author) but with a (hopefully) improved commit message. If you provide positive feedback, and nobody else has any comments, I will tag it with my Reviewed-by, which will hopefully be Greg's cue to take the patch.

Greg already took this patch a while ago :)

thanks,

greg k-h

#6 lore raw
Quoted 4 lines · Greg KH

Greg already took this patch a while ago :)

Thanks for bringing that up Greg, I'll double-check your tree next time.

Oscar, please ignore the v3 patch I posted.

Sven