staging: rdma: amso1100: Prefer using BIT Macro
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>
Fri, 16 Oct 2015 16:40:25 +0000 (22:10 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Oct 2015 06:02:55 +0000 (23:02 -0700)
Replace bit shifting on 1 with the BIT(x) Macro

The semantic patch used to find this is:
@@ int g; @@

-(1 << g)
+BIT(g)

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rdma/amso1100/c2_provider.c

index 956d76b111b088ddf49056e7f0fe4fb0a98f1a63..25632158a52a144439631871a5434180035f54f9 100644 (file)
@@ -372,7 +372,7 @@ static struct ib_mr *c2_reg_phys_mr(struct ib_pd *ib_pd,
 
                total_len += buffer_list[i].size;
                pbl_depth += ALIGN(buffer_list[i].size,
-                                  (1 << page_shift)) >> page_shift;
+                                  BIT(page_shift)) >> page_shift;
        }
 
        page_list = vmalloc(sizeof(u64) * pbl_depth);
@@ -387,7 +387,7 @@ static struct ib_mr *c2_reg_phys_mr(struct ib_pd *ib_pd,
                int naddrs;
 
                naddrs = ALIGN(buffer_list[i].size,
-                              (1 << page_shift)) >> page_shift;
+                              BIT(page_shift)) >> page_shift;
                for (k = 0; k < naddrs; k++)
                        page_list[j++] = (buffer_list[i].addr +
                                                     (k << page_shift));
@@ -408,7 +408,7 @@ static struct ib_mr *c2_reg_phys_mr(struct ib_pd *ib_pd,
                (unsigned long long) page_list[0],
                (unsigned long long) page_list[pbl_depth-1]);
        err = c2_nsmr_register_phys_kern(to_c2dev(ib_pd->device), page_list,
-                                        (1 << page_shift), pbl_depth,
+                                        BIT(page_shift), pbl_depth,
                                         total_len, 0, iova_start,
                                         c2_convert_access(acc), mr);
        vfree(page_list);