Skip to content

Commit

Permalink
drivers: api: no_os_timer: Add const qualifier to timer init param
Browse files Browse the repository at this point in the history
Some platforms are missing the const qualifier in timer_init APIs.
This commit adds the qualifier where needed, to fix compilation
warnings.

Signed-off-by: Ramona Gradinariu <[email protected]>
  • Loading branch information
rbolboac committed May 7, 2024
1 parent 18b5609 commit 7359c6f
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion drivers/api/no_os_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static void *timer_mutex_table[TIMER_MAX_TABLE + 1];
* @return 0 in case of success, negative error code otherwise
*/
int32_t no_os_timer_init(struct no_os_timer_desc **desc,
struct no_os_timer_init_param *param)
const struct no_os_timer_init_param *param)
{
int32_t ret;

Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/aducm3029/aducm3029_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static void aducm3029_tmr_callback(void *param, uint32_t tmr_event, void *arg)
* @return 0 in case of success, -1 otherwise.
*/
int32_t aducm3029_timer_init(struct no_os_timer_desc **desc,
struct no_os_timer_init_param *param)
const struct no_os_timer_init_param *param)
{
struct no_os_timer_desc *ldesc;
struct aducm_timer_desc *aducm_desc;
Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/generic/generic_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
* @return 0 in case of success, negative error code otherwise
*/
int32_t generic_timer_init(struct no_os_timer_desc **desc,
struct no_os_timer_init_param *param)
const struct no_os_timer_init_param *param)
{
NO_OS_UNUSED_PARAM(desc);
NO_OS_UNUSED_PARAM(param);
Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/linux/linux_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct linux_timer_desc {
* @return 0 in case of success, negative errno error codes otherwise.
*/
int linux_timer_init(struct no_os_timer_desc **desc,
struct no_os_timer_init_param *param)
const struct no_os_timer_init_param *param)
{
struct no_os_timer_desc *descriptor;
struct linux_timer_desc *linux_desc;
Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/maxim/max32650/maxim_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static int _get_prescaler(uint32_t div, mxc_tmr_pres_t *prescaler)
* @return 0 in case of success, negative errno error codes otherwise.
*/
int max_timer_init(struct no_os_timer_desc **desc,
struct no_os_timer_init_param *param)
const struct no_os_timer_init_param *param)
{
int ret;
uint32_t clk_div;
Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/maxim/max32655/maxim_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static int _get_prescaler(uint32_t div, mxc_tmr_pres_t *prescaler)
* @return 0 in case of success, negative errno error codes otherwise.
*/
int max_timer_init(struct no_os_timer_desc **desc,
struct no_os_timer_init_param *param)
const struct no_os_timer_init_param *param)
{
int ret;
mxc_tmr_pres_t prescaler;
Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/maxim/max32660/maxim_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static int _get_prescaler(uint32_t div, mxc_tmr_pres_t *prescaler)
* @return 0 in case of success, negative errno error codes otherwise.
*/
int max_timer_init(struct no_os_timer_desc **desc,
struct no_os_timer_init_param *param)
const struct no_os_timer_init_param *param)
{
int ret;
uint32_t clk_div;
Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/maxim/max32665/maxim_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static int _get_prescaler(uint32_t div, mxc_tmr_pres_t *prescaler)
* @return 0 in case of success, negative errno error codes otherwise.
*/
int max_timer_init(struct no_os_timer_desc **desc,
struct no_os_timer_init_param *param)
const struct no_os_timer_init_param *param)
{
int ret;
uint32_t clk_div;
Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/maxim/max32690/maxim_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static int _get_prescaler(uint32_t div, mxc_tmr_pres_t *prescaler)
* @return 0 in case of success, negative errno error codes otherwise.
*/
int max_timer_init(struct no_os_timer_desc **desc,
struct no_os_timer_init_param *param)
const struct no_os_timer_init_param *param)
{
int ret;
mxc_tmr_pres_t prescaler;
Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/maxim/max78000/maxim_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static int _get_prescaler(uint32_t div, mxc_tmr_pres_t *prescaler)
* @return 0 in case of success, negative errno error codes otherwise.
*/
int max_timer_init(struct no_os_timer_desc **desc,
struct no_os_timer_init_param *param)
const struct no_os_timer_init_param *param)
{
int ret;
mxc_tmr_pres_t prescaler;
Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/xilinx/xilinx_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ int32_t xilinx_timer_get_elapsed_time_nsec(struct no_os_timer_desc *desc,
* @return 0 in case of success, -1 otherwise
*/
int32_t xilinx_timer_init(struct no_os_timer_desc **desc,
struct no_os_timer_init_param *param)
const struct no_os_timer_init_param *param)
{
int32_t ret;
struct no_os_timer_desc *dev;
Expand Down
2 changes: 1 addition & 1 deletion include/no_os_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ struct no_os_timer_platform_ops {

/* Initialize hardware timer and the handler structure associated with it. */
int32_t no_os_timer_init(struct no_os_timer_desc **desc,
struct no_os_timer_init_param *param);
const struct no_os_timer_init_param *param);

/* Free the memory allocated by timer_setup(). */
int32_t no_os_timer_remove(struct no_os_timer_desc *desc);
Expand Down

0 comments on commit 7359c6f

Please sign in to comment.