Skip to contentSkip to conversation

rcu: Replace rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL)

PATCH In review Monam Agarwal 3 participants 3 messages Mar 18, 2014 – Mar 19, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rcu: Replace rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL)

This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL) in drivers/infiniband/hw/qib/qib_qp.c

---
 drivers/infiniband/hw/qib/qib_qp.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/hw/qib/qib_qp.c +3 -3
index 7e7e16f..1f5f04c 100644
@@ -252,10 +252,10 @@ static void remove_qp(struct qib_ibdev *dev, struct qib_qp *qp)
 
 	if (ibp->qp0 == qp) {
 		atomic_dec(&qp->refcount);
-		rcu_assign_pointer(ibp->qp0, NULL);
+		RCU_INIT_POINTER(ibp->qp0, NULL);
 	} else if (ibp->qp1 == qp) {
 		atomic_dec(&qp->refcount);
-		rcu_assign_pointer(ibp->qp1, NULL);
+		RCU_INIT_POINTER(ibp->qp1, NULL);
 	} else {
 		struct qib_qp *q, **qpp;
 
@@ -303,7 +303,7 @@ unsigned qib_free_all_qps(struct qib_devdata *dd)
 	spin_lock_irqsave(&dev->qpt_lock, flags);
 	for (n = 0; n < dev->qp_table_size; n++) {
 		qp = dev->qp_table[n];
-		rcu_assign_pointer(dev->qp_table[n], NULL);
+		RCU_INIT_POINTER(dev->qp_table[n], NULL);
 
 		for (; qp; qp = qp->next)
 			qp_inuse++;
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Monam Agarwal

This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL) in drivers/infiniband/hw/qib/qib_qp.c

Quoted 33 lines
---
 drivers/infiniband/hw/qib/qib_qp.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/hw/qib/qib_qp.c +3 -3
index 7e7e16f..1f5f04c 100644
@@ -252,10 +252,10 @@ static void remove_qp(struct qib_ibdev *dev, struct qib_qp *qp)
 
 	if (ibp->qp0 == qp) {
 		atomic_dec(&qp->refcount);
-		rcu_assign_pointer(ibp->qp0, NULL);
+		RCU_INIT_POINTER(ibp->qp0, NULL);
 	} else if (ibp->qp1 == qp) {
 		atomic_dec(&qp->refcount);
-		rcu_assign_pointer(ibp->qp1, NULL);
+		RCU_INIT_POINTER(ibp->qp1, NULL);
 	} else {
 		struct qib_qp *q, **qpp;
 
@@ -303,7 +303,7 @@ unsigned qib_free_all_qps(struct qib_devdata *dd)
 	spin_lock_irqsave(&dev->qpt_lock, flags);
 	for (n = 0; n < dev->qp_table_size; n++) {
 		qp = dev->qp_table[n];
-		rcu_assign_pointer(dev->qp_table[n], NULL);
+		RCU_INIT_POINTER(dev->qp_table[n], NULL);
 
 		for (; qp; qp = qp->next)
 			qp_inuse++;
Signature · 1 line
1.7.9.5
maintainer
#2 lore raw
In reply to Monam Agarwal

Many of your patches, such as this one, all have the same exact subject line.

This makes it impossible to scan the subject lines and have some idea what area a commit makes changes.

I would really suggest that you use a subject prefix that references the driver or subsystem, so for this one:

Subject: [PATCH N/M] infiniband: Use rcu_assign_pointer(x, NULL instead) of RCU_INIT_POINTER(x, NULL)

and likewise for all of your other patches.