Skip to contentSkip to conversation

Staging: rdma: amso1100: Fix multiple assignments on single line.

PATCH In review Weston Silbaugh 3 participants 3 messages Oct 25, 2015 1 message not in the archive

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

PATCH 2195/2195 Staging: rdma: amso1100: Fix multiple assignments on single line.

Multiple assignments should be avoided.

For example:

cm_event.ird = cm_event.ord = 128;

Should be:

cm_event.ird = 128;
cm_event.ord = 128;

---
 drivers/staging/rdma/amso1100/c2_ae.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/rdma/amso1100/c2_ae.c +4 -2
index eb7a92b..20d98b7 100644
@@ -173,7 +173,8 @@ void c2_ae_event(struct c2_dev *c2dev, u32 mq_index)
 	resource_user_context =
 	    (void *) (unsigned long) wr->ae.ae_generic.user_context;
 
-	status = cm_event.status = c2_convert_cm_status(c2_wr_get_result(wr));
+	status = c2_convert_cm_status(c2_wr_get_result(wr));
+	cm_event.status = c2_convert_cm_status(c2_wr_get_result(wr));
 
 	pr_debug("event received c2_dev=%p, event_id=%d, "
 		"resource_indicator=%d, user_context=%p, status = %d\n",
@@ -294,7 +295,8 @@ void c2_ae_event(struct c2_dev *c2dev, u32 mq_index)
 		 * Until ird/ord negotiation via MPAv2 support is added, send
 		 * max supported values
 		 */
-		cm_event.ird = cm_event.ord = 128;
+		cm_event.ird = 128;
+		cm_event.ord = 128;
 
 		if (cm_id->event_handler)
 			cm_id->event_handler(cm_id, &cm_event);
Signature · 6 lines
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1445770206-9645-1-git-send-email-weston.silbaugh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 21 lines · Weston Silbaugh

Multiple assignments should be avoided.

For example:

cm_event.ird = cm_event.ord = 128;

Should be:

cm_event.ird = 128;
cm_event.ord = 128;

---
 drivers/staging/rdma/amso1100/c2_ae.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/rdma/amso1100/c2_ae.c +0 -0
index eb7a92b..20d98b7 100644

drivers/staging/rdma/amso1100/c2_ae.c void c2_ae_event(struct c2_dev *c2dev, u32 mq_index) · line 177

Quoted 6 lines
drivers/staging/rdma/amso1100/c2_ae.c +2 -1
@@ -173,7 +173,8 @@ void c2_ae_event(struct c2_dev *c2dev, u32 mq_index)
        resource_user_context =
            (void *) (unsigned long) wr->ae.ae_generic.user_context;
 
-       status = cm_event.status = c2_convert_cm_status(c2_wr_get_result(wr));
+       status = c2_convert_cm_status(c2_wr_get_result(wr));
+       cm_event.status = c2_convert_cm_status(c2_wr_get_result(wr));

This is wrong fro two reasons:
1. In case of wrong status it will print twice the same error line "Unable to convert CM status"
2. The better solution will be to rewrite the patch to remove "status variable" at all.

Quoted 16 lines
drivers/staging/rdma/amso1100/c2_ae.c +2 -2
        pr_debug("event received c2_dev=%p, event_id=%d, "
                "resource_indicator=%d, user_context=%p, status = %d\n",
@@ -294,7 +295,8 @@ void c2_ae_event(struct c2_dev *c2dev, u32 mq_index)
                 * Until ird/ord negotiation via MPAv2 support is added, send
                 * max supported values
                 */
-               cm_event.ird = cm_event.ord = 128;
+               cm_event.ird = 128;
+               cm_event.ord = 128;
 
                if (cm_id->event_handler)
                        cm_id->event_handler(cm_id, &cm_event);
--

2.4.3

Quoted 4 lines

_______________________________________________
devel mailing list [email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to a message not in the archive
Quoted 4 lines · Weston Silbaugh

Multiple assignments should be avoided.

For example:

Quoted 8 lines

cm_event.ird = cm_event.ord = 128;

Should be:

cm_event.ird = 128;
cm_event.ord = 128;

Where are the 2194 other patches in this series?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html