cpu/x86/mp_init: retype do_smm element in mp_state struct to bool
The do_smm struct element in the mp_state struct was an int even though it only had two possible states, so change it to bool to make this more obvious. Also change the return type of is_smm_enabled from int to bool. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I8d2d95f0497649d67565243d14a5ab9c9cdda412 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65776 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
		@@ -675,23 +675,23 @@ struct mp_state {
 | 
				
			|||||||
	size_t perm_smsize;
 | 
						size_t perm_smsize;
 | 
				
			||||||
	size_t smm_save_state_size;
 | 
						size_t smm_save_state_size;
 | 
				
			||||||
	uintptr_t reloc_start32_offset;
 | 
						uintptr_t reloc_start32_offset;
 | 
				
			||||||
	int do_smm;
 | 
						bool do_smm;
 | 
				
			||||||
} mp_state;
 | 
					} mp_state;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int is_smm_enabled(void)
 | 
					static bool is_smm_enabled(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return CONFIG(HAVE_SMI_HANDLER) && mp_state.do_smm;
 | 
						return CONFIG(HAVE_SMI_HANDLER) && mp_state.do_smm;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void smm_disable(void)
 | 
					static void smm_disable(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	mp_state.do_smm = 0;
 | 
						mp_state.do_smm = false;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void smm_enable(void)
 | 
					static void smm_enable(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (CONFIG(HAVE_SMI_HANDLER))
 | 
						if (CONFIG(HAVE_SMI_HANDLER))
 | 
				
			||||||
		mp_state.do_smm = 1;
 | 
							mp_state.do_smm = true;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -72,7 +72,7 @@ extern struct mp_state {
 | 
				
			|||||||
	uintptr_t perm_smbase;
 | 
						uintptr_t perm_smbase;
 | 
				
			||||||
	size_t perm_smsize;
 | 
						size_t perm_smsize;
 | 
				
			||||||
	size_t smm_save_state_size;
 | 
						size_t smm_save_state_size;
 | 
				
			||||||
	int do_smm;
 | 
						bool do_smm;
 | 
				
			||||||
} mp_state;
 | 
					} mp_state;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef union {
 | 
					typedef union {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user