Re: [PATCH v2] IB/core: Fix unaligned accesses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/1/15 3:50 AM, Bart Van Assche wrote:
In addition to Yann's comments:

On 05/01/15 04:42, David Ahern wrote:
-static void cm_mask_copy(u8 *dst, u8 *src, u8 *mask)
+static void cm_mask_copy(u32 *dst, u32 *src, u32 *mask)

Please consider to constify the src and mask arguments.

-    for (i = 0; i < IB_CM_COMPARE_SIZE / sizeof(unsigned long); i++)
-        ((unsigned long *) dst)[i] = ((unsigned long *) src)[i] &
-                         ((unsigned long *) mask)[i];
+    for (i = 0; i < IB_CM_COMPARE_SIZE / sizeof(u32); i++)
+        dst[i] =  src[i] & mask[i];

A single space after the equals sign is sufficient.


ack

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




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux