-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers: stm32: clean indentation in instance definition macros #99085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
drivers: stm32: clean indentation in instance definition macros #99085
Conversation
0153133 to
798a1db
Compare
|
SonarCloud error reports look like false positive, e.g.: |
mathieuchopstm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise LGTM
| \ | ||
| PINCTRL_DT_INST_DEFINE(inst); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| \ | |
| PINCTRL_DT_INST_DEFINE(inst); \ | |
| PINCTRL_DT_INST_DEFINE(inst); \ |
Unless there's a rationale for the empty line I missed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, I'm fine removing it.
| #define STM32_MUX_CLK_INIT(id) \ | ||
| \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #define STM32_MUX_CLK_INIT(id) \ | |
| \ | |
| #define STM32_MUX_CLK_INIT(id) \ |
drivers/i2c/i2c_ll_stm32.c
Outdated
| .n_timings = sizeof(i2c_timings_##index) / \ | ||
| (sizeof(struct i2c_config_timing)),)) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: the "stray" / makes this a bit harder to understand now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i'll restore the previous way.
drivers/pwm/pwm_stm32.c
Outdated
| \ | ||
| static const struct stm32_pclken pclken_##index[] = \ | ||
| STM32_DT_CLOCKS(PWM(index)); \ | ||
| STM32_DT_CLOCKS(PWM(index)); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: it would be better to always use tabs rather than end with spaces (general remark, as there's - alas! - no consistency across drivers...)
| STM32_DT_CLOCKS(PWM(index)); \ | |
| STM32_DT_CLOCKS(PWM(index)); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I tend to preserve existing line when possible. That' said, I agree with you, I'll update the surrounding lines for consistency in this source file.
| \ | ||
| PINCTRL_DT_INST_DEFINE(inst); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, I'm fine removing it.
drivers/i2c/i2c_ll_stm32.c
Outdated
| .n_timings = sizeof(i2c_timings_##index) / \ | ||
| (sizeof(struct i2c_config_timing)),)) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i'll restore the previous way.
drivers/pwm/pwm_stm32.c
Outdated
| \ | ||
| static const struct stm32_pclken pclken_##index[] = \ | ||
| STM32_DT_CLOCKS(PWM(index)); \ | ||
| STM32_DT_CLOCKS(PWM(index)); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I tend to preserve existing line when possible. That' said, I agree with you, I'll update the surrounding lines for consistency in this source file.
drivers/pwm/pwm_stm32.c
Outdated
| { \ | ||
| COND_CODE_1(DT_IRQ_HAS_NAME(PWM(index), cc), \ | ||
| (IRQ_CONNECT_AND_ENABLE_BY_NAME(index, cc)), \ | ||
| (IRQ_CONNECT_AND_ENABLE_DEFAULT(index))); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI i'll remove this trailing ;.
798a1db to
e607b12
Compare
drivers/i2c/i2c_ll_stm32.c
Outdated
| IF_ENABLED(DT_HAS_COMPAT_STATUS_OKAY(st_stm32_i2c_v2), \ | ||
| (.timings = (const struct i2c_config_timing *)i2c_timings_##index, \ | ||
| .n_timings = \ | ||
| sizeof(i2c_timings_##index) / (sizeof(struct i2c_config_timing)),))\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
| sizeof(i2c_timings_##index) / (sizeof(struct i2c_config_timing)),))\ | |
| sizeof(i2c_timings_##index) / (sizeof(struct i2c_config_timing)),)) \ |
drivers/i2c/i2c_ll_stm32_rtio.c
Outdated
| .n_timings = sizeof(i2c_timings_##index) / \ | ||
| (sizeof(struct i2c_config_timing)),)) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I missed this one. Thanks.
e607b12 to
deaf7bd
Compare
Clean indentation in STM32_MCO_INIT() and STM32_MUX_CLK_INIT() macros. Add after coma pclken field value in stm32_clk_mux_cfg_##id to ease possible later changes. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Clean indentation in SDMMC_DMA_CHANNEL() macro and fix an extra line escape at last line of SDMMC_DMA_CHANNEL_INIT() macro value. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Clean indentation in I2C_DMA_DATA_INIT() and I2C_STM32_INIT() macros. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Clean indentation in STM32_I3C_DMA_CHANNEL_INIT() and STM32_I3C_DMA_CHANNEL() macros of STM32 I3C driver. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Clean indentation in IRQ_CONNECT_AND_ENABLE_BY_NAME(), IRQ_CONFIG_FUNC() and IRQ_CONNECT_AND_ENABLE_DEFAULT() macros of STM32 PWM driver. Remove a useless trailing semi column character in the interrupt function defined with IRQ_CONFIG_FUNC() macro. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Clean indentation in local macros used to define UART instances. Remove extra line escape ending CONFIG_UART_ASYNC_API() macro value. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Simplify interrupt handler helper macros by removing STM32_UART_IRQ_HANDLER_DECL(), using STM32_UART_IRQ_HANDLER() only renamed STM32_UART_IRQ_HANDLER_DEFINE() and aggregating where the macro and STM32_UART_IRQ_HANDLER_FUNC() macro are defined. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Clean indentation in macros used to define instances in STM32 HSEM hardware semaphore drivers. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
deaf7bd to
25f8f7f
Compare
|
Review comment addressed. |
|
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
Clean indentation in macros used to define STM32 driver instances resources. The main issue is a missing tabulation at the beginning of the each line participating to the macro value.
No functional changes.
A few other driver would deserve equivalent changes. I've proposed them in other P-Rs that already modify the related macros content for other purposes: stm32-clk-info P-R #98995, i2s P-R #98925.