diff options
| author | Michael Brown | 2010-06-15 18:33:23 +0200 |
|---|---|---|
| committer | Michael Brown | 2010-06-22 15:26:40 +0200 |
| commit | 4bfd5b52c1fae75eb0449af626ec69543f9334fa (patch) | |
| tree | 297bc75308e763df909fb0733c0ca2ac109ebcbc /src/net/udp | |
| parent | [pcnet32] Replace pcnet32 with native driver (diff) | |
| download | ipxe-4bfd5b52c1fae75eb0449af626ec69543f9334fa.tar.gz ipxe-4bfd5b52c1fae75eb0449af626ec69543f9334fa.tar.xz ipxe-4bfd5b52c1fae75eb0449af626ec69543f9334fa.zip | |
[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>
Diffstat (limited to 'src/net/udp')
| -rw-r--r-- | src/net/udp/dhcp.c | 4 | ||||
| -rw-r--r-- | src/net/udp/dns.c | 1 | ||||
| -rw-r--r-- | src/net/udp/slam.c | 2 | ||||
| -rw-r--r-- | src/net/udp/tftp.c | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c index 31e420c4f..33212b062 100644 --- a/src/net/udp/dhcp.c +++ b/src/net/udp/dhcp.c @@ -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 ); diff --git a/src/net/udp/dns.c b/src/net/udp/dns.c index db9c03622..47fc6c75a 100644 --- a/src/net/udp/dns.c +++ b/src/net/udp/dns.c @@ -503,6 +503,7 @@ static int dns_resolv ( struct resolv_interface *resolv, rc = -ENOMEM; goto err_alloc_dns; } + ref_init ( &dns->refcnt, NULL ); resolv_init ( &dns->resolv, &null_resolv_ops, &dns->refcnt ); xfer_init ( &dns->socket, &dns_socket_operations, &dns->refcnt ); dns->timer.expired = dns_timer_expired; diff --git a/src/net/udp/slam.c b/src/net/udp/slam.c index aa15933ec..3f0b0e2ea 100644 --- a/src/net/udp/slam.c +++ b/src/net/udp/slam.c @@ -748,7 +748,7 @@ static int slam_open ( struct xfer_interface *xfer, struct uri *uri ) { slam = zalloc ( sizeof ( *slam ) ); if ( ! slam ) return -ENOMEM; - slam->refcnt.free = slam_free; + ref_init ( &slam->refcnt, slam_free ); xfer_init ( &slam->xfer, &slam_xfer_operations, &slam->refcnt ); xfer_init ( &slam->socket, &slam_socket_operations, &slam->refcnt ); xfer_init ( &slam->mc_socket, &slam_mc_socket_operations, diff --git a/src/net/udp/tftp.c b/src/net/udp/tftp.c index d49f4256c..49c857fbf 100644 --- a/src/net/udp/tftp.c +++ b/src/net/udp/tftp.c @@ -1134,7 +1134,7 @@ static int tftp_core_open ( struct xfer_interface *xfer, struct uri *uri, tftp = zalloc ( sizeof ( *tftp ) ); if ( ! tftp ) return -ENOMEM; - tftp->refcnt.free = tftp_free; + ref_init ( &tftp->refcnt, tftp_free ); xfer_init ( &tftp->xfer, &tftp_xfer_operations, &tftp->refcnt ); tftp->uri = uri_get ( uri ); xfer_init ( &tftp->socket, &tftp_socket_operations, &tftp->refcnt ); |
