On 06/22/18 16:16, Martin Wilck wrote:
-                       sa_key = 0;
-                       for (i = 0; i < 8; ++i){
-                               if (i > 0)
-                                       sa_key <<= 8;
-                               sa_key |= paramp->sa_key[i];
-                       }
+                       sa_key = be64_to_cpu(*(uint64_t *)&paramp->sa_key[0]);

Have you considered to use get_unaligned_be64() instead of the above construct with casts?

Thanks,

Bart.

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to