Fix double const qualifier declarations

Some header files define structures like this one:

typedef const struct zio_checksum_info {
	/* ... */
	const char	*ci_name;
} zio_abd_checksum_func_t;

So we can use `zio_abd_checksum_func_t` for const declarations now.
It's not needed that we use the `const` qualifier again like this:
`const zio_abd_checksum_func_t *varname;`

This patch solves the double const qualifiers, which were found by
smatch.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Closes #13961
This commit is contained in:
Tino Reichardt
2022-10-01 00:34:39 +02:00
committed by GitHub
parent 55d7afa4ad
commit a2d5643f88
13 changed files with 18 additions and 19 deletions
+1 -1
View File
@@ -350,7 +350,7 @@ pool_active(void *unused, const char *name, uint64_t guid,
}
#endif
const pool_config_ops_t libzpool_config_ops = {
pool_config_ops_t libzpool_config_ops = {
.pco_refresh_config = refresh_config,
.pco_pool_active = pool_active,
};
+2 -3
View File
@@ -1777,8 +1777,7 @@ zpool_find_import(libpc_handle_t *hdl, importargs_t *iarg)
nvlist_t *
zpool_search_import(void *hdl, importargs_t *import,
const pool_config_ops_t *pco)
zpool_search_import(void *hdl, importargs_t *import, pool_config_ops_t *pco)
{
libpc_handle_t handle = { 0 };
nvlist_t *pools = NULL;
@@ -1821,7 +1820,7 @@ pool_match(nvlist_t *cfg, char *tgt)
int
zpool_find_config(void *hdl, const char *target, nvlist_t **configp,
importargs_t *args, const pool_config_ops_t *pco)
importargs_t *args, pool_config_ops_t *pco)
{
nvlist_t *pools;
nvlist_t *match = NULL;
+1 -1
View File
@@ -43,7 +43,7 @@ typedef struct libpc_handle {
boolean_t lpc_open_access_error;
boolean_t lpc_desc_active;
char lpc_desc[1024];
const pool_config_ops_t *lpc_ops;
pool_config_ops_t *lpc_ops;
void *lpc_lib_handle;
} libpc_handle_t;