All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firewire: core: typecast from gfp_t to bool more safely
@ 2013-04-28 22:16 Stefan Richter
  0 siblings, 0 replies; only message in thread
From: Stefan Richter @ 2013-04-28 22:16 UTC (permalink / raw)
  To: linux1394-devel; +Cc: linux-kernel

An idr related patch introduced the following sparse warning:
  drivers/firewire/core-cdev.c:488:33: warning: incorrect type in initializer (different base types)
  drivers/firewire/core-cdev.c:488:33:    expected bool [unsigned] [usertype] preload
  drivers/firewire/core-cdev.c:488:33:    got restricted gfp_t
So let's convert from gfp_t bitfield to Boolean explicitly and safely.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
 drivers/firewire/core-cdev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -485,7 +485,7 @@ static int ioctl_get_info(struct client
 static int add_client_resource(struct client *client,
 			       struct client_resource *resource, gfp_t gfp_mask)
 {
-	bool preload = gfp_mask & __GFP_WAIT;
+	bool preload = !!(gfp_mask & __GFP_WAIT);
 	unsigned long flags;
 	int ret;
 


-- 
Stefan Richter
-=====-===-= -=-- ===-=
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-04-28 22:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-28 22:16 [PATCH] firewire: core: typecast from gfp_t to bool more safely Stefan Richter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.