* [PATCH] x86/head64: Harmonize the style of array-type parameter for fixup_pointer
@ 2023-07-20 13:15 Wang Jinchao
0 siblings, 0 replies; 3+ messages in thread
From: Wang Jinchao @ 2023-07-20 13:15 UTC (permalink / raw)
To: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen,
linux-scsi, linux-kernel
Cc: stone.xulei
The usage of '&' before the array parameter is redundant because '&array'
is equivalent to 'array'. Therefore, there is no need to include '&'
before the array parameter. In fact, using '&' can cause more confusion,
especially for individuals who are not familiar with the address-of
operation for arrays. They might mistakenly believe that one is different
from the other and spend additional time realizing that they are actually
the same.
Harmonizing the style by removing the unnecessary '&' would save time for
those individuals.
Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
---
arch/x86/kernel/head64.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 49f7629b17f7..25a67a13a1fa 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -211,7 +211,7 @@ unsigned long __head __startup_64(unsigned long physaddr,
/* Fixup the physical addresses in the page table */
- pgd = fixup_pointer(&early_top_pgt, physaddr);
+ pgd = fixup_pointer(early_top_pgt, physaddr);
p = pgd + pgd_index(__START_KERNEL_map);
if (la57)
*p = (unsigned long)level4_kernel_pgt;
@@ -220,11 +220,11 @@ unsigned long __head __startup_64(unsigned long physaddr,
*p += _PAGE_TABLE_NOENC - __START_KERNEL_map + load_delta;
if (la57) {
- p4d = fixup_pointer(&level4_kernel_pgt, physaddr);
+ p4d = fixup_pointer(level4_kernel_pgt, physaddr);
p4d[511] += load_delta;
}
- pud = fixup_pointer(&level3_kernel_pgt, physaddr);
+ pud = fixup_pointer(level3_kernel_pgt, physaddr);
pud[510] += load_delta;
pud[511] += load_delta;
--
2.40.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] x86/head64: Harmonize the style of array-type parameter for fixup_pointer
@ 2023-08-03 9:44 Wang Jinchao
2023-10-03 9:33 ` [tip: x86/boot] x86/boot: Harmonize the style of array-type parameter for fixup_pointer() calls tip-bot2 for Wang Jinchao
0 siblings, 1 reply; 3+ messages in thread
From: Wang Jinchao @ 2023-08-03 9:44 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, linux-kernel
Cc: stone.xulei
The usage of '&' before the array parameter is redundant because '&array'
is equivalent to 'array'. Therefore, there is no need to include '&'
before the array parameter. In fact, using '&' can cause more confusion,
especially for individuals who are not familiar with the address-of
operation for arrays. They might mistakenly believe that one is different
from the other and spend additional time realizing that they are actually
the same.
Harmonizing the style by removing the unnecessary '&' would save time for
those individuals.
Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
---
arch/x86/kernel/head64.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 49f7629b17f7..25a67a13a1fa 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -211,7 +211,7 @@ unsigned long __head __startup_64(unsigned long physaddr,
/* Fixup the physical addresses in the page table */
- pgd = fixup_pointer(&early_top_pgt, physaddr);
+ pgd = fixup_pointer(early_top_pgt, physaddr);
p = pgd + pgd_index(__START_KERNEL_map);
if (la57)
*p = (unsigned long)level4_kernel_pgt;
@@ -220,11 +220,11 @@ unsigned long __head __startup_64(unsigned long physaddr,
*p += _PAGE_TABLE_NOENC - __START_KERNEL_map + load_delta;
if (la57) {
- p4d = fixup_pointer(&level4_kernel_pgt, physaddr);
+ p4d = fixup_pointer(level4_kernel_pgt, physaddr);
p4d[511] += load_delta;
}
- pud = fixup_pointer(&level3_kernel_pgt, physaddr);
+ pud = fixup_pointer(level3_kernel_pgt, physaddr);
pud[510] += load_delta;
pud[511] += load_delta;
--
2.40.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [tip: x86/boot] x86/boot: Harmonize the style of array-type parameter for fixup_pointer() calls
2023-08-03 9:44 [PATCH] x86/head64: Harmonize the style of array-type parameter for fixup_pointer Wang Jinchao
@ 2023-10-03 9:33 ` tip-bot2 for Wang Jinchao
0 siblings, 0 replies; 3+ messages in thread
From: tip-bot2 for Wang Jinchao @ 2023-10-03 9:33 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Wang Jinchao, Ingo Molnar, x86, linux-kernel
The following commit has been merged into the x86/boot branch of tip:
Commit-ID: 9f76d606269be7bd1ee5942b7c9c21bb0b43825f
Gitweb: https://git.kernel.org/tip/9f76d606269be7bd1ee5942b7c9c21bb0b43825f
Author: Wang Jinchao <wangjinchao@xfusion.com>
AuthorDate: Thu, 03 Aug 2023 17:44:00 +08:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 03 Oct 2023 11:28:38 +02:00
x86/boot: Harmonize the style of array-type parameter for fixup_pointer() calls
The usage of '&' before the array parameter is redundant because '&array'
is equivalent to 'array'. Therefore, there is no need to include '&'
before the array parameter. In fact, using '&' can cause more confusion,
especially for individuals who are not familiar with the address-of
operation for arrays. They might mistakenly believe that one is different
from the other and spend additional time realizing that they are actually
the same.
Harmonizing the style by removing the unnecessary '&' would save time for
those individuals.
Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/ZMt24BGEX9IhPSY6@fedora
---
arch/x86/kernel/head64.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index bbc2179..d6ca9c5 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -211,7 +211,7 @@ unsigned long __head __startup_64(unsigned long physaddr,
/* Fixup the physical addresses in the page table */
- pgd = fixup_pointer(&early_top_pgt, physaddr);
+ pgd = fixup_pointer(early_top_pgt, physaddr);
p = pgd + pgd_index(__START_KERNEL_map);
if (la57)
*p = (unsigned long)level4_kernel_pgt;
@@ -220,11 +220,11 @@ unsigned long __head __startup_64(unsigned long physaddr,
*p += _PAGE_TABLE_NOENC - __START_KERNEL_map + load_delta;
if (la57) {
- p4d = fixup_pointer(&level4_kernel_pgt, physaddr);
+ p4d = fixup_pointer(level4_kernel_pgt, physaddr);
p4d[511] += load_delta;
}
- pud = fixup_pointer(&level3_kernel_pgt, physaddr);
+ pud = fixup_pointer(level3_kernel_pgt, physaddr);
pud[510] += load_delta;
pud[511] += load_delta;
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-03 9:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-03 9:44 [PATCH] x86/head64: Harmonize the style of array-type parameter for fixup_pointer Wang Jinchao
2023-10-03 9:33 ` [tip: x86/boot] x86/boot: Harmonize the style of array-type parameter for fixup_pointer() calls tip-bot2 for Wang Jinchao
-- strict thread matches above, loose matches on Subject: below --
2023-07-20 13:15 [PATCH] x86/head64: Harmonize the style of array-type parameter for fixup_pointer Wang Jinchao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox