Skip to content

Commit

Permalink
Add 'const' qualifier to bf_sys_log parameters (#28)
Browse files Browse the repository at this point in the history
- Declared the parameters to bf_sys_log_init() to be const
  pointers, so you can pass a literal string to them without
  getting compile errors. Did the same for several other
  functions that aren't part of the external interface.

Signed-off-by: Derek G Foster <[email protected]>
  • Loading branch information
ffoulkes authored Apr 30, 2024
1 parent e475d46 commit 240969c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/target-sys/bf_sal/bf_sys_log.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright(c) 2021 Intel Corporation.
* Copyright(c) 2021-2024 Intel Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this software except as stipulated in the License.
Expand Down Expand Up @@ -106,7 +106,7 @@ extern "C" {
* @return
* 0 on Sucess, -1 on error
*/
int bf_sys_log_init(void *arg1, void *arg2, void *arg3);
int bf_sys_log_init(const void *arg1, const void *arg2, const void *arg3);

/**
* close bf_sys_log subsystem
Expand Down
6 changes: 3 additions & 3 deletions src/bf_sal/linux_usr/bf_sys_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ static int bf_sys_zlog_init(const char *arg1) {
return 0;
}

int bf_sys_log_zlog_reconfig(char *cfg_file_name) {
int bf_sys_log_zlog_reconfig(const char *cfg_file_name) {
if (zlog_reload(cfg_file_name) != 0) {
printf("error initializing bf_sys_log\n");
return -1;
}
return 0;
}

zlog_category_t *bf_sys_log_get_cat(char *category_name) {
zlog_category_t *bf_sys_log_get_cat(const char *category_name) {
return (zlog_get_category(category_name));
}

Expand All @@ -189,7 +189,7 @@ static int bf_sys_trace_init(int default_level) {
/* arg1 - Path to logging config file.
* arg2 - Trace level.
* arg3 - Trace size. */
int bf_sys_log_init(void *arg1, void *arg2, void *arg3) {
int bf_sys_log_init(const void *arg1, const void *arg2, const void *arg3) {
int err;
(void)arg3;

Expand Down

0 comments on commit 240969c

Please sign in to comment.