Skip to content

Commit 1556753

Browse files
shiqingglijinxia
authored andcommitted
hv: unify the function pointer assignment
Assign function pointer without the unary & operator. Take 'register_io_emulation_handler' as an example: void register_io_emulation_handler(struct acrn_vm *vm, const struct vm_io_range *range, io_read_fn_t io_read_fn_ptr, io_write_fn_t io_write_fn_ptr) The last two parameters are function pointer. Sometimes we use function designator directly, while sometimes with the unary & operator, as shown below. - without & register_io_emulation_handler(vm, &range, vuart_read, vuart_write); - with & register_io_emulation_handler(vm, &pci_cfg_range, &pci_cfg_io_read, &pci_cfg_io_write); To unify the coding style, we will go with the first way. Tracked-On: #861 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 9a009bc commit 1556753

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

hypervisor/dm/vpci/vpci.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ void vpci_init(struct acrn_vm *vm)
131131
#endif
132132

133133
if ((vpci->ops->init != NULL) && (vpci->ops->init(vm) == 0)) {
134-
register_io_emulation_handler(vm, PCI_PIO_IDX, &pci_cfg_range,
135-
&pci_cfg_io_read, &pci_cfg_io_write);
134+
register_io_emulation_handler(vm, PCI_PIO_IDX, &pci_cfg_range, pci_cfg_io_read, pci_cfg_io_write);
136135
/* This is a tmp solution to avoid sos reboot failure, it need pass-thru IO port CF9 for Reset Control
137136
* register.
138137
*/

hypervisor/dm/vpic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -867,11 +867,11 @@ static void vpic_register_io_handler(struct acrn_vm *vm)
867867
};
868868

869869
register_io_emulation_handler(vm, PIC_MASTER_PIO_IDX, &master_range,
870-
&vpic_master_io_read, &vpic_master_io_write);
870+
vpic_master_io_read, vpic_master_io_write);
871871
register_io_emulation_handler(vm, PIC_SLAVE_PIO_IDX, &slave_range,
872-
&vpic_slave_io_read, &vpic_slave_io_write);
872+
vpic_slave_io_read, vpic_slave_io_write);
873873
register_io_emulation_handler(vm, PIC_ELC_PIO_IDX, &elcr_range,
874-
&vpic_elc_io_read, &vpic_elc_io_write);
874+
vpic_elc_io_read, vpic_elc_io_write);
875875
}
876876

877877
void vpic_init(struct acrn_vm *vm)

0 commit comments

Comments
 (0)