Re: [PATCH v2 5/8] scsi: ufs: core: Enable multi-level gear scaling

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

 





On 1/23/2025 2:32 AM, Bart Van Assche wrote:
On 1/22/25 2:02 AM, Ziqi Chen wrote:
+    if (target_gear) {
+        memcpy(&new_pwr_info, &hba->pwr_info,
+               sizeof(struct ufs_pa_layer_attr));

Why memcpy() instead of an assignment? The advantage of an assignment is that the compiler can perform type checking.

Thanks,

Bart.


Hi Bart,

We use memcpy() here is due to memcpy() can be faster than direct assignment. We don't worry about safety because they are same struct "ufs_pa_layer_attr" so that we can ensure the accuracy of number of bytes and member type.

-Ziqi




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux