[PATCH 06/10] riscv/vdso: Use generic union vdso_data_store

Anna-Maria Behnsen posted 10 patches 1 year, 11 months ago
[PATCH 06/10] riscv/vdso: Use generic union vdso_data_store
Posted by Anna-Maria Behnsen 1 year, 11 months ago
There is already a generic union definition for vdso_data_store in vdso
datapage header.

Use this definition to prevent code duplication.

Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: linux-riscv@lists.infradead.org
---
 arch/riscv/kernel/vdso.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c
index 2cf76218a5bd..100cdea6d3e3 100644
--- a/arch/riscv/kernel/vdso.c
+++ b/arch/riscv/kernel/vdso.c
@@ -30,13 +30,7 @@ enum rv_vdso_map {
 
 #define VVAR_SIZE  (VVAR_NR_PAGES << PAGE_SHIFT)
 
-/*
- * The vDSO data page.
- */
-static union {
-	struct vdso_data	data;
-	u8			page[PAGE_SIZE];
-} vdso_data_store __page_aligned_data;
+static union vdso_data_store vdso_data_store __page_aligned_data;
 struct vdso_data *vdso_data = &vdso_data_store.data;
 
 struct __vdso_info {
-- 
2.39.2
Re: [PATCH 06/10] riscv/vdso: Use generic union vdso_data_store
Posted by kernel test robot 1 year, 11 months ago
Hi Anna-Maria,

kernel test robot noticed the following build errors:

[auto build test ERROR on s390/features]
[also build test ERROR on kees/for-next/execve arm64/for-next/core linus/master v6.8-rc5 next-20240219]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Anna-Maria-Behnsen/vdso-helpers-Fix-grammar-in-comments/20240219-234251
base:   https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features
patch link:    https://lore.kernel.org/r/20240219153939.75719-7-anna-maria%40linutronix.de
patch subject: [PATCH 06/10] riscv/vdso: Use generic union vdso_data_store
config: riscv-allnoconfig (https://download.01.org/0day-ci/archive/20240220/202402201410.g0YeFhx8-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240220/202402201410.g0YeFhx8-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402201410.g0YeFhx8-lkp@intel.com/

All errors (new ones prefixed by >>):

>> arch/riscv/kernel/vdso.c:34:31: error: initialization of 'struct vdso_data *' from incompatible pointer type 'struct vdso_data (*)[2]' [-Werror=incompatible-pointer-types]
      34 | struct vdso_data *vdso_data = &vdso_data_store.data;
         |                               ^
   cc1: some warnings being treated as errors


vim +34 arch/riscv/kernel/vdso.c

78a743cd82a35c Tong Tiangen       2021-09-01  32  
2f3f68e0423414 Anna-Maria Behnsen 2024-02-19  33  static union vdso_data_store vdso_data_store __page_aligned_data;
ad5d1122b82fbd Vincent Chen       2020-06-09 @34  struct vdso_data *vdso_data = &vdso_data_store.data;
76d2a0493a17d4 Palmer Dabbelt     2017-07-10  35  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
[PATCH v1a] riscv/vdso: Use generic union vdso_data_store
Posted by Anna-Maria Behnsen 1 year, 11 months ago
There is already a generic union definition for vdso_data_store in vdso
datapage header.

Use this definition to prevent code duplication.

Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: linux-riscv@lists.infradead.org
---
 arch/riscv/kernel/vdso.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c
index 2cf76218a5bd..98315b98256d 100644
--- a/arch/riscv/kernel/vdso.c
+++ b/arch/riscv/kernel/vdso.c
@@ -30,14 +30,8 @@ enum rv_vdso_map {
 
 #define VVAR_SIZE  (VVAR_NR_PAGES << PAGE_SHIFT)
 
-/*
- * The vDSO data page.
- */
-static union {
-	struct vdso_data	data;
-	u8			page[PAGE_SIZE];
-} vdso_data_store __page_aligned_data;
-struct vdso_data *vdso_data = &vdso_data_store.data;
+static union vdso_data_store vdso_data_store __page_aligned_data;
+struct vdso_data *vdso_data = vdso_data_store.data;
 
 struct __vdso_info {
 	const char *name;
-- 
2.39.2
[tip: timers/core] riscv: vdso: Use generic union vdso_data_store
Posted by tip-bot2 for Anna-Maria Behnsen 1 year, 11 months ago
The following commit has been merged into the timers/core branch of tip:

Commit-ID:     eba755314fa7bcb147193f51a44546697f3888f1
Gitweb:        https://git.kernel.org/tip/eba755314fa7bcb147193f51a44546697f3888f1
Author:        Anna-Maria Behnsen <anna-maria@linutronix.de>
AuthorDate:    Tue, 20 Feb 2024 09:52:12 +01:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 20 Feb 2024 20:56:00 +01:00

riscv: vdso: Use generic union vdso_data_store

There is already a generic union definition for vdso_data_store in the vdso
datapage header.

Use this definition to prevent code duplication.

Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240220085212.6547-1-anna-maria@linutronix.de

---
 arch/riscv/kernel/vdso.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c
index 2cf7621..98315b9 100644
--- a/arch/riscv/kernel/vdso.c
+++ b/arch/riscv/kernel/vdso.c
@@ -30,14 +30,8 @@ enum rv_vdso_map {
 
 #define VVAR_SIZE  (VVAR_NR_PAGES << PAGE_SHIFT)
 
-/*
- * The vDSO data page.
- */
-static union {
-	struct vdso_data	data;
-	u8			page[PAGE_SIZE];
-} vdso_data_store __page_aligned_data;
-struct vdso_data *vdso_data = &vdso_data_store.data;
+static union vdso_data_store vdso_data_store __page_aligned_data;
+struct vdso_data *vdso_data = vdso_data_store.data;
 
 struct __vdso_info {
 	const char *name;