Skip to contentSkip to conversation

firewire: core: typecast from gfp_t to bool more safely

PATCH New Stefan Richter 1 participant 1 message Apr 28, 2013 Firewire

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firewire: core: typecast from gfp_t to bool more safely

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.

---
 drivers/firewire/core-cdev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firewire/core-cdev.c +1 -1
@@ -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;
 
Signature · 3 lines
Stefan Richter
-=====-===-= -=-- ===-=
http://arcgraph.de/sr/