Re: How to understand the comment of macro *compute_indices*?

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

 



On Tue, 14 Jul 2020 07:54:04 +0800, carver said:
> Hello,
>
> Macro *compute_indices* in arch/arm64/kernel/head.S have a comment
> as shown below:
> 	mov     \istart, \ptrs
> 	mul     \istart, \istart, \count
> 	add     \iend, \iend, \istart   // iend += (count - 1) * ptrs
>
> I am wondering whether this comment should be change to
> "iend += count * ptrs".

Examine the uses of the macro, and see where they expect the result
to be pointing if there is exactly one entry. (Hint - what's the address of
the first entry of a C array, and what's the next location after the array,
and how would the corresponding C code for iterating across the array
have as the termination condition?)

Attachment: pgpbz3gNQqCjc.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux