Skip to content

Commit

Permalink
os/pm: Resolve Build Warnings
Browse files Browse the repository at this point in the history
This commit resolve the below build warnings:

warning: 'pm_state_name' defined but not used
warning: 'wakeup_src_name' defined but not used
warning: unused variable 'pm_state'
warning: assignment discards 'const' qualifier from pointer target type
  • Loading branch information
gSahitya-samsung committed Oct 24, 2024
1 parent 242d998 commit 0ba62bf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 0 additions & 4 deletions os/include/tinyara/pm/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ enum pm_state_e {
*/
PM_COUNT,
};
static const char *pm_state_name[PM_COUNT] = {"PM_NORMAL", "PM_IDLE", "PM_STANDBY", "PM_SLEEP"};

/* This enumeration provides all power management related wakeup source code. */

Expand All @@ -198,9 +197,6 @@ typedef enum {
PM_WAKEUP_SRC_COUNT,
} pm_wakeup_reason_code_t;

#ifdef CONFIG_PM_METRICS
static const char *wakeup_src_name[PM_WAKEUP_SRC_COUNT] = {"UNKNOWN", "BLE", "WIFI", "UART CONSOLE", "UART TTYS2", "GPIO", "HW TIMER"};
#endif
/* This structure contain pointers callback functions in the driver. These
* callback functions can be used to provide power management information
* to the driver.
Expand Down
3 changes: 2 additions & 1 deletion os/pm/pm_metrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ typedef struct pm_metric_s pm_metric_t;

static pm_metric_t *g_pm_metrics;
static bool g_pm_metrics_running = false;
static const char *wakeup_src_name[PM_WAKEUP_SRC_COUNT] = {"UNKNOWN", "BLE", "WIFI", "UART CONSOLE", "UART TTYS2", "GPIO", "HW TIMER"};

static void pm_print_metrics(double total_time, int n_domains)
{
Expand Down Expand Up @@ -272,7 +273,7 @@ int pm_metrics(int milliseconds)
/* Avoid board sleep during PM Metrics initialization */
pm_suspended = pm_suspend(PM_IDLE_DOMAIN);
/* Allocate memory for initializing PM Metrics measurements */
g_pm_metrics = pm_alloc(1, sizeof(pm_metric_t));
g_pm_metrics = (pm_metric_t *)pm_alloc(1, sizeof(pm_metric_t));
if (g_pm_metrics == NULL) {
set_errno(ENOMEM);
pmdbg("Unable to initialize pm_metrics, error = %d\n", get_errno());
Expand Down
5 changes: 3 additions & 2 deletions os/pm/pm_procfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ static int power_stat(const char *relpath, FAR struct stat *buf);
#define POWER_LEVEL_3 3
#define POWER_LEVEL_4 4

static const char *pm_state_name[PM_COUNT] = {"PM_NORMAL", "PM_IDLE", "PM_STANDBY", "PM_SLEEP"};

/****************************************************************************
* Public Data
****************************************************************************/
Expand Down Expand Up @@ -230,7 +232,7 @@ static int power_find_dirref(FAR const char *relpath, FAR struct power_dir_s *di
}
return ERROR;
}
str = relpath;
str = (char *)relpath;
dir->domain_id = -1;
/* Check relpath has "power" mount point */
if (checkStart(POWER, true) == OK) {
Expand Down Expand Up @@ -350,7 +352,6 @@ static ssize_t power_read(FAR struct file *filep, FAR char *buffer, size_t bufle
size_t totalsize;
int domain_id;
int last_read;
int pm_state;
/* Function to copy domain information into buffer */
void readprint(const char *format, ...) {
size_t copysize;
Expand Down

0 comments on commit 0ba62bf

Please sign in to comment.