mirror of
https://github.com/ipxe/ipxe
synced 2026-02-28 03:11:18 +03:00
[refcnt] Add ref_init() wrapper function
Standardise on using ref_init() to initialise an embedded reference count, to match the coding style used by other embedded objects. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -1439,7 +1439,7 @@ int start_dhcp ( struct job_interface *job, struct net_device *netdev ) {
|
||||
dhcp = zalloc ( sizeof ( *dhcp ) );
|
||||
if ( ! dhcp )
|
||||
return -ENOMEM;
|
||||
dhcp->refcnt.free = dhcp_free;
|
||||
ref_init ( &dhcp->refcnt, dhcp_free );
|
||||
job_init ( &dhcp->job, &dhcp_job_operations, &dhcp->refcnt );
|
||||
xfer_init ( &dhcp->xfer, &dhcp_xfer_operations, &dhcp->refcnt );
|
||||
dhcp->netdev = netdev_get ( netdev );
|
||||
@@ -1542,7 +1542,7 @@ int start_pxebs ( struct job_interface *job, struct net_device *netdev,
|
||||
sizeof ( *ip ) /* terminator */ );
|
||||
if ( ! dhcp )
|
||||
return -ENOMEM;
|
||||
dhcp->refcnt.free = dhcp_free;
|
||||
ref_init ( &dhcp->refcnt, dhcp_free );
|
||||
job_init ( &dhcp->job, &dhcp_job_operations, &dhcp->refcnt );
|
||||
xfer_init ( &dhcp->xfer, &dhcp_xfer_operations, &dhcp->refcnt );
|
||||
dhcp->netdev = netdev_get ( netdev );
|
||||
|
||||
Reference in New Issue
Block a user