All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] staging: Prefer using BIT Macro
@ 2015-10-16 16:37 Amitoj Kaur Chawla
  2015-10-16 16:39 ` [PATCH 1/5] staging: rdma: hfi1: " Amitoj Kaur Chawla
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-16 16:37 UTC (permalink / raw)
  To: outreachy-kernel

This patchset replaces bit shifting on 1 with the BIT(x) Macro

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

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

Amitoj Kaur Chawla (5):
  staging: rdma: hfi1: Prefer using BIT Macro
  staging: rdma: amso1100: Prefer using BIT Macro
  staging: panel: Prefer using BIT Macro
  staging: vt6656: Prefer using BIT Macro
  staging: vt6655: Prefer using BIT Macro

 drivers/staging/panel/panel.c               | 6 +++---
 drivers/staging/rdma/amso1100/c2_provider.c | 6 +++---
 drivers/staging/rdma/hfi1/file_ops.c        | 2 +-
 drivers/staging/vt6655/card.c               | 2 +-
 drivers/staging/vt6656/card.c               | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/5] staging: rdma: hfi1: Prefer using BIT Macro
  2015-10-16 16:37 [PATCH 0/5] staging: Prefer using BIT Macro Amitoj Kaur Chawla
@ 2015-10-16 16:39 ` Amitoj Kaur Chawla
  2015-10-16 16:40 ` [PATCH 2/5] staging: rdma: amso1100: " Amitoj Kaur Chawla
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-16 16:39 UTC (permalink / raw)
  To: outreachy-kernel

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>
---
 drivers/staging/rdma/hfi1/file_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rdma/hfi1/file_ops.c b/drivers/staging/rdma/hfi1/file_ops.c
index 7d28680..cbaf4f7 100644
--- a/drivers/staging/rdma/hfi1/file_ops.c
+++ b/drivers/staging/rdma/hfi1/file_ops.c
@@ -508,7 +508,7 @@ static int hfi1_file_mmap(struct file *fp, struct vm_area_struct *vma)
 	case PIO_BUFS_SOP:
 		memaddr = ((dd->physaddr + TXE_PIO_SEND) +
 				/* chip pio base */
-			   (uctxt->sc->hw_context * (1 << 16))) +
+			   (uctxt->sc->hw_context * BIT(16))) +
 				/* 64K PIO space / ctxt */
 			(type == PIO_BUFS_SOP ?
 				(TXE_PIO_SIZE / 2) : 0); /* sop? */
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/5] staging: rdma: amso1100: Prefer using BIT Macro
  2015-10-16 16:37 [PATCH 0/5] staging: Prefer using BIT Macro Amitoj Kaur Chawla
  2015-10-16 16:39 ` [PATCH 1/5] staging: rdma: hfi1: " Amitoj Kaur Chawla
@ 2015-10-16 16:40 ` Amitoj Kaur Chawla
  2015-10-16 16:41 ` [PATCH 3/5] staging: panel: " Amitoj Kaur Chawla
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-16 16:40 UTC (permalink / raw)
  To: outreachy-kernel

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>
---
 drivers/staging/rdma/amso1100/c2_provider.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rdma/amso1100/c2_provider.c b/drivers/staging/rdma/amso1100/c2_provider.c
index 956d76b..e44ad22 100644
--- a/drivers/staging/rdma/amso1100/c2_provider.c
+++ b/drivers/staging/rdma/amso1100/c2_provider.c
@@ -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);
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/5] staging: panel: Prefer using BIT Macro
  2015-10-16 16:37 [PATCH 0/5] staging: Prefer using BIT Macro Amitoj Kaur Chawla
  2015-10-16 16:39 ` [PATCH 1/5] staging: rdma: hfi1: " Amitoj Kaur Chawla
  2015-10-16 16:40 ` [PATCH 2/5] staging: rdma: amso1100: " Amitoj Kaur Chawla
@ 2015-10-16 16:41 ` Amitoj Kaur Chawla
  2015-10-16 16:42 ` [PATCH 4/5] staging: vt6656: " Amitoj Kaur Chawla
  2015-10-16 16:43 ` [PATCH 5/5] staging: vt6655: " Amitoj Kaur Chawla
  4 siblings, 0 replies; 6+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-16 16:41 UTC (permalink / raw)
  To: outreachy-kernel

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>
---
 drivers/staging/panel/panel.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index a7e3875..b47da2b 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -1794,7 +1794,7 @@ static void phys_scan_contacts(void)
 		 * So we'll scan them.
 		 */
 		for (bit = 0; bit < 8; bit++) {
-			bitval = 1 << bit;
+			bitval = BIT(bit);
 
 			if (!(scan_mask_o & bitval))	/* skip unused bits */
 				continue;
@@ -2060,12 +2060,12 @@ static int input_name2mask(const char *name, pmask_t *mask, pmask_t *value,
 			return 0;	/* input name not found */
 		neg = (in & 1);	/* odd (lower) names are negated */
 		in >>= 1;
-		im |= (1 << in);
+		im |= BIT(in);
 
 		name++;
 		if (isdigit(*name)) {
 			out = *name - '0';
-			om |= (1 << out);
+			om |= BIT(out);
 		} else if (*name == '-') {
 			out = 8;
 		} else {
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/5] staging: vt6656: Prefer using BIT Macro
  2015-10-16 16:37 [PATCH 0/5] staging: Prefer using BIT Macro Amitoj Kaur Chawla
                   ` (2 preceding siblings ...)
  2015-10-16 16:41 ` [PATCH 3/5] staging: panel: " Amitoj Kaur Chawla
@ 2015-10-16 16:42 ` Amitoj Kaur Chawla
  2015-10-16 16:43 ` [PATCH 5/5] staging: vt6655: " Amitoj Kaur Chawla
  4 siblings, 0 replies; 6+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-16 16:42 UTC (permalink / raw)
  To: outreachy-kernel

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>
---
 drivers/staging/vt6656/card.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 167dca9..70685e5 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -473,7 +473,7 @@ int vnt_ofdm_min_rate(struct vnt_private *priv)
 	int ii;
 
 	for (ii = RATE_54M; ii >= RATE_6M; ii--) {
-		if ((priv->basic_rates) & ((u16)(1 << ii)))
+		if ((priv->basic_rates) & ((u16)BIT(ii)))
 			return true;
 	}
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 5/5] staging: vt6655: Prefer using BIT Macro
  2015-10-16 16:37 [PATCH 0/5] staging: Prefer using BIT Macro Amitoj Kaur Chawla
                   ` (3 preceding siblings ...)
  2015-10-16 16:42 ` [PATCH 4/5] staging: vt6656: " Amitoj Kaur Chawla
@ 2015-10-16 16:43 ` Amitoj Kaur Chawla
  4 siblings, 0 replies; 6+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-16 16:43 UTC (permalink / raw)
  To: outreachy-kernel

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>
---
 drivers/staging/vt6655/card.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 4640b56..f07d933 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -808,7 +808,7 @@ bool CARDbIsOFDMinBasicRate(struct vnt_private *pDevice)
 	int ii;
 
 	for (ii = RATE_54M; ii >= RATE_6M; ii--) {
-		if ((pDevice->basic_rates) & ((u32)(1 << ii)))
+		if ((pDevice->basic_rates) & ((u32)BIT(ii)))
 			return true;
 	}
 	return false;
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-10-16 16:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-16 16:37 [PATCH 0/5] staging: Prefer using BIT Macro Amitoj Kaur Chawla
2015-10-16 16:39 ` [PATCH 1/5] staging: rdma: hfi1: " Amitoj Kaur Chawla
2015-10-16 16:40 ` [PATCH 2/5] staging: rdma: amso1100: " Amitoj Kaur Chawla
2015-10-16 16:41 ` [PATCH 3/5] staging: panel: " Amitoj Kaur Chawla
2015-10-16 16:42 ` [PATCH 4/5] staging: vt6656: " Amitoj Kaur Chawla
2015-10-16 16:43 ` [PATCH 5/5] staging: vt6655: " Amitoj Kaur Chawla

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.