From 177bafd4cccf505df0d02ace0d235af78cac4d8a Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Mon, 1 May 2023 00:24:37 +0200 Subject: [PATCH] pld: move in pld.h the pld_driver's declaration The static analyser 'sparse' complains, while compiling a pld driver, that the struct pld_driver is declared in the file as non static, but it is not exposed through an include file. The message is: warning: symbol 'XXX' was not declared. Should it be static? Move the list of pld_driver's declaration in pld.h Change-Id: I0f917aecc7534c1b51af0afa9b32ccfd33db3511 Signed-off-by: Antonio Borneo Reviewed-on: https://review.openocd.org/c/openocd/+/7663 Tested-by: jenkins --- src/pld/pld.c | 9 --------- src/pld/pld.h | 7 +++++++ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/pld/pld.c b/src/pld/pld.c index dd8f8263f..7dd2cec18 100644 --- a/src/pld/pld.c +++ b/src/pld/pld.c @@ -16,15 +16,6 @@ #include -/* pld drivers - */ -extern struct pld_driver efinix_pld; -extern struct pld_driver gatemate_pld; -extern struct pld_driver gowin_pld; -extern struct pld_driver intel_pld; -extern struct pld_driver lattice_pld; -extern struct pld_driver virtex2_pld; - static struct pld_driver *pld_drivers[] = { &efinix_pld, &gatemate_pld, diff --git a/src/pld/pld.h b/src/pld/pld.h index a7cd20f64..322b96ec6 100644 --- a/src/pld/pld.h +++ b/src/pld/pld.h @@ -38,4 +38,11 @@ struct pld_device *get_pld_device_by_num(int num); #define ERROR_PLD_DEVICE_INVALID (-1000) #define ERROR_PLD_FILE_LOAD_FAILED (-1001) +extern struct pld_driver efinix_pld; +extern struct pld_driver gatemate_pld; +extern struct pld_driver gowin_pld; +extern struct pld_driver intel_pld; +extern struct pld_driver lattice_pld; +extern struct pld_driver virtex2_pld; + #endif /* OPENOCD_PLD_PLD_H */