Skip to content

Commit 6b6aa80

Browse files
fyin1acrnsi
authored andcommitted
hv: pm: fix coding style issue
This patch fix the coding style issue introduced by previous two patches. Tracked-On: #3564 Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
1 parent f039d75 commit 6b6aa80

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

hypervisor/arch/x86/guest/pm.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,27 +149,27 @@ static bool pm1ab_io_read(struct acrn_vcpu *vcpu, uint16_t addr, size_t width)
149149
return true;
150150
}
151151

152-
#define POWEROFF_TIMEOUT (5 * 60U) /* default poweroff timeout is 5 minutes */
152+
#define POWEROFF_TIMEOUT (300U) /* default poweroff timeout is 5 minutes */
153153
/* wait for other vm shutdown done. If POWEROFF_TIMEOUT passed and there are
154154
* still some VMs active, we will force platform power off.
155155
*
156156
* TODO:
157157
* - Let user configure whether we wait for ever till all VMs powered off or
158158
* force shutdown once pre-defined timeout hit.
159159
*/
160-
static inline void wait_for_other_vm_shutdown(struct acrn_vm *self_vm)
160+
static inline void wait_for_other_vm_shutdown(const struct acrn_vm *self_vm)
161161
{
162162
uint16_t vm_id;
163163
bool ready_for_s5;
164-
uint32_t timeout = POWEROFF_TIMEOUT;
164+
uint32_t timeout = (uint32_t)POWEROFF_TIMEOUT;
165165
struct acrn_vm *vm;
166166

167167
while (timeout != 0U) {
168168
ready_for_s5 = true;
169169
for (vm_id = 0U; vm_id < CONFIG_MAX_VM_NUM; vm_id++) {
170170
vm = get_vm_from_vmid(vm_id);
171171

172-
if ((vm != self_vm) && !is_poweroff_vm(vm)) {
172+
if ((vm != self_vm) && (!is_poweroff_vm(vm))) {
173173
ready_for_s5 = false;
174174
}
175175
}
@@ -184,9 +184,10 @@ static inline void wait_for_other_vm_shutdown(struct acrn_vm *self_vm)
184184
}
185185
}
186186

187-
static inline void enter_s5(struct acrn_vm *vm, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
187+
static inline void enter_s5(const struct acrn_vm *vm, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
188188
{
189189
wait_for_other_vm_shutdown(vm);
190+
pr_err("yfwyfw: before enter s5");
190191
host_enter_s5(vm->pm.sx_state_data, pm1a_cnt_val, pm1b_cnt_val);
191192
}
192193

hypervisor/arch/x86/pm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static uint32_t acpi_gas_read(const struct acpi_generic_address *gas)
120120
}
121121

122122
/* This function supports enter S3 or S5 according to the value given to pm1a_cnt_val and pm1b_cnt_val */
123-
void do_acpi_sx(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
123+
void do_acpi_sx(const struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
124124
{
125125
uint32_t s1, s2;
126126

@@ -148,12 +148,12 @@ void do_acpi_sx(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint
148148
} while ((s1 & (1U << BIT_WAK_STS)) == 0U);
149149
}
150150

151-
void host_enter_s5(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
151+
void host_enter_s5(const struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
152152
{
153153
do_acpi_sx(sstate_data, pm1a_cnt_val, pm1b_cnt_val);
154154
}
155155

156-
void host_enter_s3(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
156+
void host_enter_s3(const struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val)
157157
{
158158
uint64_t pmain_entry_saved;
159159

hypervisor/include/arch/x86/host_pm.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ struct acpi_reset_reg {
3030
};
3131

3232
struct pm_s_state_data *get_host_sstate_data(void);
33-
void host_enter_s3(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val);
34-
void host_enter_s5(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val);
35-
extern void asm_enter_s3(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val);
33+
void host_enter_s3(const struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val);
34+
void host_enter_s5(const struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val);
35+
void do_acpi_sx(const struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val);
36+
extern void asm_enter_s3(const struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, uint32_t pm1b_cnt_val);
3637
extern void restore_s3_context(void);
3738
struct cpu_state_info *get_cpu_pm_state_info(void);
3839
struct acpi_reset_reg *get_host_reset_reg_data(void);

0 commit comments

Comments
 (0)