Skip to contentSkip to conversation

x86/platform/uv: functions should not be declared extern

PATCH In review Qiheng Lin 2 participants 4 messages May 31, 2021 – Jun 1, 2021

Subsystems (3)
lore
Share & tools
lore

Qiheng Lin

author
#0 lore raw

PATCH 1/1 x86/platform/uv: functions should not be declared extern

These function declarations in 'bios.h' are already marked extern, thus their definition should not have the keyword.

This quiets the following sparse warnings:
function 'uv_bios_get_master_nasid' with external linkage has definition function 'uv_bios_get_heapsize' with external linkage has definition function 'uv_bios_install_heap' with external linkage has definition function 'uv_bios_obj_count' with external linkage has definition function 'uv_bios_enum_objs' with external linkage has definition function 'uv_bios_enum_ports' with external linkage has definition function 'uv_bios_get_geoinfo' with external linkage has definition function 'uv_bios_get_pci_topology' with external linkage has definition

---
 arch/x86/platform/uv/bios_uv.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch/x86/platform/uv/bios_uv.c +8 -8
index bf31af3d32d6..7e7634c8be62 100644
@@ -172,55 +172,55 @@ int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus)
 				(u64)decode, (u64)domain, (u64)bus, 0, 0);
 }
 
-extern s64 uv_bios_get_master_nasid(u64 size, u64 *master_nasid)
+s64 uv_bios_get_master_nasid(u64 size, u64 *master_nasid)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, 0, UV_BIOS_EXTRA_MASTER_NASID, 0,
 				size, (u64)master_nasid);
 }
 EXPORT_SYMBOL_GPL(uv_bios_get_master_nasid);
 
-extern s64 uv_bios_get_heapsize(u64 nasid, u64 size, u64 *heap_size)
+s64 uv_bios_get_heapsize(u64 nasid, u64 size, u64 *heap_size)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_GET_HEAPSIZE,
 				0, size, (u64)heap_size);
 }
 EXPORT_SYMBOL_GPL(uv_bios_get_heapsize);
 
-extern s64 uv_bios_install_heap(u64 nasid, u64 heap_size, u64 *bios_heap)
+s64 uv_bios_install_heap(u64 nasid, u64 heap_size, u64 *bios_heap)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_INSTALL_HEAP,
 				0, heap_size, (u64)bios_heap);
 }
 EXPORT_SYMBOL_GPL(uv_bios_install_heap);
 
-extern s64 uv_bios_obj_count(u64 nasid, u64 size, u64 *objcnt)
+s64 uv_bios_obj_count(u64 nasid, u64 size, u64 *objcnt)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_OBJECT_COUNT,
 				0, size, (u64)objcnt);
 }
 EXPORT_SYMBOL_GPL(uv_bios_obj_count);
 
-extern s64 uv_bios_enum_objs(u64 nasid, u64 size, u64 *objbuf)
+s64 uv_bios_enum_objs(u64 nasid, u64 size, u64 *objbuf)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_ENUM_OBJECTS,
 				0, size, (u64)objbuf);
 }
 EXPORT_SYMBOL_GPL(uv_bios_enum_objs);
 
-extern s64 uv_bios_enum_ports(u64 nasid, u64 obj_id, u64 size, u64 *portbuf)
+s64 uv_bios_enum_ports(u64 nasid, u64 obj_id, u64 size, u64 *portbuf)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_ENUM_PORTS,
 				obj_id, size, (u64)portbuf);
 }
 EXPORT_SYMBOL_GPL(uv_bios_enum_ports);
 
-extern s64 uv_bios_get_geoinfo(u64 nasid, u64 size, u64 *buf)
+s64 uv_bios_get_geoinfo(u64 nasid, u64 size, u64 *buf)
 {
 	return uv_bios_call(UV_BIOS_GET_GEOINFO, nasid, (u64)buf, size, 0, 0);
 }
 EXPORT_SYMBOL_GPL(uv_bios_get_geoinfo);
 
-extern s64 uv_bios_get_pci_topology(u64 size, u64 *buf)
+s64 uv_bios_get_pci_topology(u64 size, u64 *buf)
 {
 	return uv_bios_call(UV_BIOS_GET_PCI_TOPOLOGY, (u64)buf, size, 0, 0, 0);
 }
Signature · 1 line
2.31.1
#1 lore raw

Hi,

Quoted 13 lines · Qiheng Lin

These function declarations in 'bios.h' are already marked extern, thus their definition should not have the keyword.

This quiets the following sparse warnings:
function 'uv_bios_get_master_nasid' with external linkage has definition function 'uv_bios_get_heapsize' with external linkage has definition function 'uv_bios_install_heap' with external linkage has definition function 'uv_bios_obj_count' with external linkage has definition function 'uv_bios_enum_objs' with external linkage has definition function 'uv_bios_enum_ports' with external linkage has definition function 'uv_bios_get_geoinfo' with external linkage has definition function 'uv_bios_get_pci_topology' with external linkage has definition

Quoted 1 line

Thank you for your patch, I've applied this patch to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window.

Regards,

Hans

Quoted 73 lines
---
 arch/x86/platform/uv/bios_uv.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch/x86/platform/uv/bios_uv.c +8 -8
index bf31af3d32d6..7e7634c8be62 100644
@@ -172,55 +172,55 @@ int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus)
 				(u64)decode, (u64)domain, (u64)bus, 0, 0);
 }
 
-extern s64 uv_bios_get_master_nasid(u64 size, u64 *master_nasid)
+s64 uv_bios_get_master_nasid(u64 size, u64 *master_nasid)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, 0, UV_BIOS_EXTRA_MASTER_NASID, 0,
 				size, (u64)master_nasid);
 }
 EXPORT_SYMBOL_GPL(uv_bios_get_master_nasid);
 
-extern s64 uv_bios_get_heapsize(u64 nasid, u64 size, u64 *heap_size)
+s64 uv_bios_get_heapsize(u64 nasid, u64 size, u64 *heap_size)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_GET_HEAPSIZE,
 				0, size, (u64)heap_size);
 }
 EXPORT_SYMBOL_GPL(uv_bios_get_heapsize);
 
-extern s64 uv_bios_install_heap(u64 nasid, u64 heap_size, u64 *bios_heap)
+s64 uv_bios_install_heap(u64 nasid, u64 heap_size, u64 *bios_heap)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_INSTALL_HEAP,
 				0, heap_size, (u64)bios_heap);
 }
 EXPORT_SYMBOL_GPL(uv_bios_install_heap);
 
-extern s64 uv_bios_obj_count(u64 nasid, u64 size, u64 *objcnt)
+s64 uv_bios_obj_count(u64 nasid, u64 size, u64 *objcnt)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_OBJECT_COUNT,
 				0, size, (u64)objcnt);
 }
 EXPORT_SYMBOL_GPL(uv_bios_obj_count);
 
-extern s64 uv_bios_enum_objs(u64 nasid, u64 size, u64 *objbuf)
+s64 uv_bios_enum_objs(u64 nasid, u64 size, u64 *objbuf)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_ENUM_OBJECTS,
 				0, size, (u64)objbuf);
 }
 EXPORT_SYMBOL_GPL(uv_bios_enum_objs);
 
-extern s64 uv_bios_enum_ports(u64 nasid, u64 obj_id, u64 size, u64 *portbuf)
+s64 uv_bios_enum_ports(u64 nasid, u64 obj_id, u64 size, u64 *portbuf)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_ENUM_PORTS,
 				obj_id, size, (u64)portbuf);
 }
 EXPORT_SYMBOL_GPL(uv_bios_enum_ports);
 
-extern s64 uv_bios_get_geoinfo(u64 nasid, u64 size, u64 *buf)
+s64 uv_bios_get_geoinfo(u64 nasid, u64 size, u64 *buf)
 {
 	return uv_bios_call(UV_BIOS_GET_GEOINFO, nasid, (u64)buf, size, 0, 0);
 }
 EXPORT_SYMBOL_GPL(uv_bios_get_geoinfo);
 
-extern s64 uv_bios_get_pci_topology(u64 size, u64 *buf)
+s64 uv_bios_get_pci_topology(u64 size, u64 *buf)
 {
 	return uv_bios_call(UV_BIOS_GET_PCI_TOPOLOGY, (u64)buf, size, 0, 0, 0);
 }
#2 lore raw

Hi,

Quoted 22 lines · Hans de Goede

Hi,

Quoted 13 lines · Qiheng Lin

These function declarations in 'bios.h' are already marked extern, thus their definition should not have the keyword.

This quiets the following sparse warnings:
function 'uv_bios_get_master_nasid' with external linkage has definition function 'uv_bios_get_heapsize' with external linkage has definition function 'uv_bios_install_heap' with external linkage has definition function 'uv_bios_obj_count' with external linkage has definition function 'uv_bios_enum_objs' with external linkage has definition function 'uv_bios_enum_ports' with external linkage has definition function 'uv_bios_get_geoinfo' with external linkage has definition function 'uv_bios_get_pci_topology' with external linkage has definition

Quoted 1 line

Thank you for your patch, I've applied this patch to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Quoted 7 lines

Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window.

Correction I just noticed that this makes changes under arch/x86 so this should go upstream through the tip tree.

So I'm dropping this patch from review-hans now, sorry for the noise.

Regards,

Hans

Quoted 73 lines
Quoted 73 lines
---
 arch/x86/platform/uv/bios_uv.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch/x86/platform/uv/bios_uv.c +8 -8
index bf31af3d32d6..7e7634c8be62 100644
@@ -172,55 +172,55 @@ int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus)
 				(u64)decode, (u64)domain, (u64)bus, 0, 0);
 }
 
-extern s64 uv_bios_get_master_nasid(u64 size, u64 *master_nasid)
+s64 uv_bios_get_master_nasid(u64 size, u64 *master_nasid)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, 0, UV_BIOS_EXTRA_MASTER_NASID, 0,
 				size, (u64)master_nasid);
 }
 EXPORT_SYMBOL_GPL(uv_bios_get_master_nasid);
 
-extern s64 uv_bios_get_heapsize(u64 nasid, u64 size, u64 *heap_size)
+s64 uv_bios_get_heapsize(u64 nasid, u64 size, u64 *heap_size)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_GET_HEAPSIZE,
 				0, size, (u64)heap_size);
 }
 EXPORT_SYMBOL_GPL(uv_bios_get_heapsize);
 
-extern s64 uv_bios_install_heap(u64 nasid, u64 heap_size, u64 *bios_heap)
+s64 uv_bios_install_heap(u64 nasid, u64 heap_size, u64 *bios_heap)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_INSTALL_HEAP,
 				0, heap_size, (u64)bios_heap);
 }
 EXPORT_SYMBOL_GPL(uv_bios_install_heap);
 
-extern s64 uv_bios_obj_count(u64 nasid, u64 size, u64 *objcnt)
+s64 uv_bios_obj_count(u64 nasid, u64 size, u64 *objcnt)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_OBJECT_COUNT,
 				0, size, (u64)objcnt);
 }
 EXPORT_SYMBOL_GPL(uv_bios_obj_count);
 
-extern s64 uv_bios_enum_objs(u64 nasid, u64 size, u64 *objbuf)
+s64 uv_bios_enum_objs(u64 nasid, u64 size, u64 *objbuf)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_ENUM_OBJECTS,
 				0, size, (u64)objbuf);
 }
 EXPORT_SYMBOL_GPL(uv_bios_enum_objs);
 
-extern s64 uv_bios_enum_ports(u64 nasid, u64 obj_id, u64 size, u64 *portbuf)
+s64 uv_bios_enum_ports(u64 nasid, u64 obj_id, u64 size, u64 *portbuf)
 {
 	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_ENUM_PORTS,
 				obj_id, size, (u64)portbuf);
 }
 EXPORT_SYMBOL_GPL(uv_bios_enum_ports);
 
-extern s64 uv_bios_get_geoinfo(u64 nasid, u64 size, u64 *buf)
+s64 uv_bios_get_geoinfo(u64 nasid, u64 size, u64 *buf)
 {
 	return uv_bios_call(UV_BIOS_GET_GEOINFO, nasid, (u64)buf, size, 0, 0);
 }
 EXPORT_SYMBOL_GPL(uv_bios_get_geoinfo);
 
-extern s64 uv_bios_get_pci_topology(u64 size, u64 *buf)
+s64 uv_bios_get_pci_topology(u64 size, u64 *buf)
 {
 	return uv_bios_call(UV_BIOS_GET_PCI_TOPOLOGY, (u64)buf, size, 0, 0, 0);
 }
author
#3 lore raw
In reply to Qiheng Lin
Quoted 77 lines · Qiheng Lin

These function declarations in 'bios.h' are already marked extern, thus their definition should not have the keyword.

This quiets the following sparse warnings:
function 'uv_bios_get_master_nasid' with external linkage has definition function 'uv_bios_get_heapsize' with external linkage has definition function 'uv_bios_install_heap' with external linkage has definition function 'uv_bios_obj_count' with external linkage has definition function 'uv_bios_enum_objs' with external linkage has definition function 'uv_bios_enum_ports' with external linkage has definition function 'uv_bios_get_geoinfo' with external linkage has definition function 'uv_bios_get_pci_topology' with external linkage has definition

---
  arch/x86/platform/uv/bios_uv.c | 16 ++++++++--------
  1 file changed, 8 insertions(+), 8 deletions(-)
arch/x86/platform/uv/bios_uv.c +7 -7
index bf31af3d32d6..7e7634c8be62 100644
@@ -172,55 +172,55 @@ int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus)
  				(u64)decode, (u64)domain, (u64)bus, 0, 0);
  }
 
-extern s64 uv_bios_get_master_nasid(u64 size, u64 *master_nasid)
+s64 uv_bios_get_master_nasid(u64 size, u64 *master_nasid)
  {
  	return uv_bios_call(UV_BIOS_EXTRA, 0, UV_BIOS_EXTRA_MASTER_NASID, 0,
  				size, (u64)master_nasid);
  }
  EXPORT_SYMBOL_GPL(uv_bios_get_master_nasid);
 
-extern s64 uv_bios_get_heapsize(u64 nasid, u64 size, u64 *heap_size)
+s64 uv_bios_get_heapsize(u64 nasid, u64 size, u64 *heap_size)
  {
  	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_GET_HEAPSIZE,
  				0, size, (u64)heap_size);
  }
  EXPORT_SYMBOL_GPL(uv_bios_get_heapsize);
 
-extern s64 uv_bios_install_heap(u64 nasid, u64 heap_size, u64 *bios_heap)
+s64 uv_bios_install_heap(u64 nasid, u64 heap_size, u64 *bios_heap)
  {
  	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_INSTALL_HEAP,
  				0, heap_size, (u64)bios_heap);
  }
  EXPORT_SYMBOL_GPL(uv_bios_install_heap);
 
-extern s64 uv_bios_obj_count(u64 nasid, u64 size, u64 *objcnt)
+s64 uv_bios_obj_count(u64 nasid, u64 size, u64 *objcnt)
  {
  	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_OBJECT_COUNT,
  				0, size, (u64)objcnt);
  }
  EXPORT_SYMBOL_GPL(uv_bios_obj_count);
 
-extern s64 uv_bios_enum_objs(u64 nasid, u64 size, u64 *objbuf)
+s64 uv_bios_enum_objs(u64 nasid, u64 size, u64 *objbuf)
  {
  	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_ENUM_OBJECTS,
  				0, size, (u64)objbuf);
  }
  EXPORT_SYMBOL_GPL(uv_bios_enum_objs);
 
-extern s64 uv_bios_enum_ports(u64 nasid, u64 obj_id, u64 size, u64 *portbuf)
+s64 uv_bios_enum_ports(u64 nasid, u64 obj_id, u64 size, u64 *portbuf)
  {
  	return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_ENUM_PORTS,
  				obj_id, size, (u64)portbuf);
  }
  EXPORT_SYMBOL_GPL(uv_bios_enum_ports);
 
-extern s64 uv_bios_get_geoinfo(u64 nasid, u64 size, u64 *buf)
+s64 uv_bios_get_geoinfo(u64 nasid, u64 size, u64 *buf)

arch/x86/platform/uv/bios_uv.c int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus) · line 226

Quoted 10 lines
arch/x86/platform/uv/bios_uv.c +1 -1
  {
  	return uv_bios_call(UV_BIOS_GET_GEOINFO, nasid, (u64)buf, size, 0, 0);
  }
  EXPORT_SYMBOL_GPL(uv_bios_get_geoinfo);
 
-extern s64 uv_bios_get_pci_topology(u64 size, u64 *buf)
+s64 uv_bios_get_pci_topology(u64 size, u64 *buf)
  {
  	return uv_bios_call(UV_BIOS_GET_PCI_TOPOLOGY, (u64)buf, size, 0, 0, 0);
  }

I have sent a new patch with the correct subject and commit messages, please ignore this version.

Sorry for the noise.