]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
firewire: core: typecast from gfp_t to bool more safely
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Sun, 28 Apr 2013 22:16:14 +0000 (00:16 +0200)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Tue, 30 Jul 2013 13:46:18 +0000 (15:46 +0200)
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

index ac1b43a0428531273c4fdaefd56a0b83f1545ce2..d7d5c8af92b9754fa79aa632c69d9ffc1fb27420 100644 (file)
@@ -486,7 +486,7 @@ static int ioctl_get_info(struct client *client, union ioctl_arg *arg)
 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;