staging: gpib: Fix CONFIG_GPIB_HP82341 build failure
Subsystems (3)
cover staging: gpib: Fix CONFIG_GPIB_HP82341 build failure
The driver was causing a build failure when comiled as a module because the isapnp_read_byte symbol was undefined.
Patch 1 fixes a compile error introduced by an intervening patch Patch 2 exports the isapnp_read_byte symbol for modules Patch 3 removes the dependency on BROKEN in Kconfig
Dave Penkler (3):
staging: gpib: Fix pr_err format warning
pnp: isapnp: Export isapnp_read_byte again
staging: gpib: Remove depends on BROKEN
drivers/pnp/isapnp/core.c | 1 + drivers/staging/gpib/Kconfig | 1 - drivers/staging/gpib/hp_82341/hp_82341.c | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.47.1
PATCH 1/3 staging: gpib: Fix pr_err format warning
This patch fixes the following compile warning:
drivers/staging/gpib/hp_82341/hp_82341.c: In function 'hp_82341_attach':./include/linux/kern_levels.h:5:25: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'u32' {aka 'unsigned int'} [-Wformat=]
It was introduced in
commit baf8855c9160 ("staging: gpib: fix address space mixup")
but was not detected as the build of the driver depended on BROKEN.
--- drivers/staging/gpib/hp_82341/hp_82341.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/gpib/hp_82341/hp_82341.c +1 -1
@@ -727,7 +727,7 @@ static int hp_82341_attach(gpib_board_t *board, const gpib_board_config_t *confifor (i =0 ; i < hp_82341_num_io_regions; ++i) { start_addr = iobase + i * hp_priv->io_region_offset;if (!request_region (start_addr, hp_82341_region_iosize,"hp_82341" )) { -pr_err ("hp_82341: failed to allocate io ports 0x%lx-0x%lx\n" , +pr_err ("hp_82341: failed to allocate io ports 0x%x-0x%x\n" , start_addr, start_addr + hp_82341_region_iosize -1 );return -EIO ;
Signature · 1 line
2.47.1
PATCH 2/3 pnp: isapnp: Export isapnp_read_byte again
In reply to Dave PenklerThe build of drivers/staging/gpib/hp_82341 driver was failing with:
ERROR: modpost: "isapnp_read_byte" [drivers/staging/gpib/hp_82341/hp_82341.ko] undefined!
because the symbol was not exported for modules.
There were no errors building with allyesconfig
The symbol was removed by
because it was no longer used by any mainline modules.
Export the symbol again.
--- drivers/pnp/isapnp/core.c | 1 + 1 file changed, 1 insertion(+)
drivers/pnp/isapnp/core.c +1 -0
@@ -843,6 +843,7 @@ EXPORT_SYMBOL(isapnp_protocol);EXPORT_SYMBOL (isapnp_present);EXPORT_SYMBOL (isapnp_cfg_begin);EXPORT_SYMBOL (isapnp_cfg_end); +EXPORT_SYMBOL (isapnp_read_byte);EXPORT_SYMBOL (isapnp_write_byte);static int isapnp_get_resources (struct pnp_dev *dev)
Signature · 1 line
2.47.1
PATCH 3/3 staging: gpib: Remove depends on BROKEN
In reply to Dave PenklerThe build of drivers/staging/gpib/hp_82341 driver was failing with:
ERROR: modpost: "isapnp_read_byte" [drivers/staging/gpib/hp_82341/hp_82341.ko] undefined!
The driver was marked BROKEN to fix this issue
Remove the dependency on BROKEN
--- drivers/staging/gpib/Kconfig | 1 - 1 file changed, 1 deletion(-)
drivers/staging/gpib/Kconfig +0 -1
@@ -169,7 +169,6 @@ config GPIB_HP82341 tristate "HP82341x" select GPIB_COMMON select GPIB_TMS9914 - depends on BROKEN depends on ISA_BUS || EISA help GPIB driver for HP82341 A/B/C/D boards
Signature · 1 line
2.47.1
kernel test robot
build botRe: [PATCH 3/3] staging: gpib: Remove depends on BROKEN
kernel test robot noticed the following build warnings:
Hi Dave,
kernel test robot noticed the following build warnings:
[auto build test WARNING on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/Dave-Penkler/staging-gpib-Fix-pr_err-format-warning/20250124-190232 base: staging/staging-testing patch link: https://lore.kernel.org/r/20250124105900.27592-4-dpenkler%40gmail.com patch subject: [PATCH 3/3] staging: gpib: Remove depends on BROKEN config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20250125/[email protected]/config) compiler: alpha-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250125/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/staging/gpib/hp_82341/hp_82341.c:802:35: warning: 'hp_82341_pnp_table' defined but not used [-Wunused-const-variable=]
802 | static const struct pnp_device_id hp_82341_pnp_table[] = {
| ^~~~~~~~~~~~~~~~~~vim +/hp_82341_pnp_table +802 drivers/staging/gpib/hp_82341/hp_82341.c
6d4f8749cd5da8 Dave Penkler 2024-09-18 801
6d4f8749cd5da8 Dave Penkler 2024-09-18 @802 static const struct pnp_device_id hp_82341_pnp_table[] = {
6d4f8749cd5da8 Dave Penkler 2024-09-18 803 {.id = "HWP1411"},
6d4f8749cd5da8 Dave Penkler 2024-09-18 804 {.id = ""}
6d4f8749cd5da8 Dave Penkler 2024-09-18 805 };
6d4f8749cd5da8 Dave Penkler 2024-09-18 806 MODULE_DEVICE_TABLE(pnp, hp_82341_pnp_table);6d4f8749cd5da8 Dave Penkler 2024-09-18 807
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [PATCH 3/3] staging: gpib: Remove depends on BROKEN
In reply to Dave Penklerkernel test robot noticed the following build warnings:
Hi Dave,
kernel test robot noticed the following build warnings:
[auto build test WARNING on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/Dave-Penkler/staging-gpib-Fix-pr_err-format-warning/20250124-190232 base: staging/staging-testing patch link: https://lore.kernel.org/r/20250124105900.27592-4-dpenkler%40gmail.com patch subject: [PATCH 3/3] staging: gpib: Remove depends on BROKEN config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250125/[email protected]/config) compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250125/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/staging/gpib/hp_82341/hp_82341.c:802:35: warning: unused variable 'hp_82341_pnp_table' [-Wunused-const-variable]
802 | static const struct pnp_device_id hp_82341_pnp_table[] = {
| ^~~~~~~~~~~~~~~~~~1 warning generated.
vim +/hp_82341_pnp_table +802 drivers/staging/gpib/hp_82341/hp_82341.c
6d4f8749cd5da8 Dave Penkler 2024-09-18 801
6d4f8749cd5da8 Dave Penkler 2024-09-18 @802 static const struct pnp_device_id hp_82341_pnp_table[] = {
6d4f8749cd5da8 Dave Penkler 2024-09-18 803 {.id = "HWP1411"},
6d4f8749cd5da8 Dave Penkler 2024-09-18 804 {.id = ""}
6d4f8749cd5da8 Dave Penkler 2024-09-18 805 };
6d4f8749cd5da8 Dave Penkler 2024-09-18 806 MODULE_DEVICE_TABLE(pnp, hp_82341_pnp_table);6d4f8749cd5da8 Dave Penkler 2024-09-18 807
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Re: [PATCH 3/3] staging: gpib: Remove depends on BROKEN
Quoted 29 lines · kernel test robot
Hi Dave,
kernel test robot noticed the following build warnings:
[auto build test WARNING on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/Dave-Penkler/staging-gpib-Fix-pr_err-format-warning/20250124-190232 base: staging/staging-testing patch link: https://lore.kernel.org/r/20250124105900.27592-4-dpenkler%40gmail.com patch subject: [PATCH 3/3] staging: gpib: Remove depends on BROKEN config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250125/[email protected]/config) compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250125/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/All warnings (new ones prefixed by >>):
Quoted 1 line
Quoted 1 line
drivers/staging/gpib/hp_82341/hp_82341.c:802:35: warning: unused variable 'hp_82341_pnp_table' [-Wunused-const-variable]802 | static const struct pnp_device_id hp_82341_pnp_table[] = { | ^~~~~~~~~~~~~~~~~~1 warning generated.
vim +/hp_82341_pnp_table +802
drivers/staging/gpib/hp_82341/hp_82341.c
Quoted 8 lines
6d4f8749cd5da8Dave Penkler 2024-09-18 8016d4f8749cd5da8 Dave Penkler 2024-09-18 @802 static const struct pnp_device_id hp_82341_pnp_table[] = { 6d4f8749cd5da8 Dave Penkler 2024-09-18 803 {.id = "HWP1411"}, 6d4f8749cd5da8 Dave Penkler 2024-09-18 804 {.id = ""} 6d4f8749cd5da8 Dave Penkler 2024-09-18 805 }; 6d4f8749cd5da8 Dave Penkler 2024-09-18 806 MODULE_DEVICE_TABLE(pnp, hp_82341_pnp_table);
6d4f8749cd5da8Dave Penkler 2024-09-18 807
The MODULE_DEVICE_TABLE macro does not really "use" the hp_82341_pnp_table variable. It just generates a mangled symbol with it but it also adds the unused attribute. However when compiled as a built-in the macro is a no-op and so the variable is flagged as unused.
I think the unused pnp_device_id variables and their MODULE_DEVICE_TABLE declarations can safely be removed or bracketed by an #ifdef MODULE
The same problem exists in drivers/staging/gpib/tnt4882/tnt4882_gpib.c and drivers/comedi/drivers/ni_atmio.c
-dave
kernel test robot
build botRe: [PATCH 3/3] staging: gpib: Remove depends on BROKEN
In reply to Dave Penklerkernel test robot noticed the following build errors:
Hi Dave,
kernel test robot noticed the following build errors:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/Dave-Penkler/staging-gpib-Fix-pr_err-format-warning/20250124-190232 base: staging/staging-testing patch link: https://lore.kernel.org/r/20250124105900.27592-4-dpenkler%40gmail.com patch subject: [PATCH 3/3] staging: gpib: Remove depends on BROKEN config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20250125/[email protected]/config) compiler: alpha-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250125/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
alpha-linux-ld: drivers/staging/gpib/hp_82341/hp_82341.o: in function `read_and_clear_event_status':
>> (.text+0x1400): multiple definition of `read_and_clear_event_status'; drivers/staging/gpib/agilent_82350b/agilent_82350b.o:(.text+0x13c0): first defined here alpha-linux-ld: drivers/staging/gpib/hp_82341/hp_82341.o: in function `read_transfer_counter': >> (.text+0x1480): multiple definition of `read_transfer_counter'; drivers/staging/gpib/agilent_82350b/agilent_82350b.o:(.text+0x1440): first defined here alpha-linux-ld: drivers/staging/gpib/hp_82341/hp_82341.o: in function `set_transfer_counter': >> (.text+0x1510): multiple definition of `set_transfer_counter'; drivers/staging/gpib/agilent_82350b/agilent_82350b.o:(.text+0x14d0): first defined here
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Re: [PATCH 3/3] staging: gpib: Remove depends on BROKEN
Quoted 19 lines · kernel test robot
Hi Dave,
kernel test robot noticed the following build errors:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/Dave-Penkler/staging-gpib-Fix-pr_err-format-warning/20250124-190232 base: staging/staging-testing patch link: https://lore.kernel.org/r/20250124105900.27592-4-dpenkler%40gmail.com patch subject: [PATCH 3/3] staging: gpib: Remove depends on BROKEN config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20250125/[email protected]/config) compiler: alpha-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250125/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Quoted 12 lines
All errors (new ones prefixed by >>):
alpha-linux-ld: drivers/staging/gpib/hp_82341/hp_82341.o: in function `read_and_clear_event_status':Quoted 1 line
Quoted 1 line
(.text+0x1400): multiple definition of `read_and_clear_event_status'; drivers/staging/gpib/agilent_82350b/agilent_82350b.o:(.text+0x13c0): first defined here
alpha-linux-ld:
drivers/staging/gpib/hp_82341/hp_82341.o: in function `read_transfer_counter':Quoted 1 line
Quoted 1 line
(.text+0x1480): multiple definition of `read_transfer_counter'; drivers/staging/gpib/agilent_82350b/agilent_82350b.o:(.text+0x1440): first defined here
alpha-linux-ld:
drivers/staging/gpib/hp_82341/hp_82341.o: in function `set_transfer_counter':Quoted 1 line
Quoted 1 line
(.text+0x1510): multiple definition of `set_transfer_counter'; drivers/staging/gpib/agilent_82350b/agilent_82350b.o:(.text+0x14d0): first defined here
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
This problem has been resolved by a previous patch:
This patch has not yet been applied to the staging-testing branch.
-dave