Skip to content

Commit 9f95c8f

Browse files
pdietlcarlescufi
authored andcommitted
drivers: pinctrl: Fix unused parameter warnings when compiling with -Wextra
Since the pinctrl header file can be included by user-created drivers, an application developer including this file and only applying -Wextra to the application source files will see many warnings. -Wold-style-declaration warning is also emitted if 'static' is not at the beginning of a declaration. Signed-off-by: Pete Dietl <[email protected]>
1 parent 5d9e31e commit 9f95c8f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/zephyr/drivers/pinctrl.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ struct pinctrl_dev_config {
238238
LISTIFY(DT_NUM_PINCTRL_STATES(node_id), \
239239
Z_PINCTRL_STATE_PINS_DEFINE, (;), node_id); \
240240
Z_PINCTRL_STATES_DEFINE(node_id) \
241-
Z_PINCTRL_DEV_CONFIG_CONST Z_PINCTRL_DEV_CONFIG_STATIC \
241+
Z_PINCTRL_DEV_CONFIG_STATIC Z_PINCTRL_DEV_CONFIG_CONST \
242242
struct pinctrl_dev_config Z_PINCTRL_DEV_CONFIG_NAME(node_id) = \
243243
Z_PINCTRL_DEV_CONFIG_INIT(node_id)
244244

@@ -320,6 +320,7 @@ static inline int pinctrl_apply_state_direct(
320320
#ifdef CONFIG_PINCTRL_STORE_REG
321321
reg = config->reg;
322322
#else
323+
ARG_UNUSED(config);
323324
reg = PINCTRL_REG_NONE;
324325
#endif
325326

@@ -441,6 +442,9 @@ static inline int pinctrl_update_states(
441442
struct pinctrl_dev_config *config,
442443
const struct pinctrl_state *states, uint8_t state_cnt)
443444
{
445+
ARG_UNUSED(config);
446+
ARG_UNUSED(states);
447+
ARG_UNUSED(state_cnt);
444448
return -ENOSYS;
445449
}
446450
#endif /* defined(CONFIG_PINCTRL_DYNAMIC) || defined(__DOXYGEN__) */

0 commit comments

Comments
 (0)