diff options
| author | Michael Brown | 2007-07-08 23:02:45 +0200 |
|---|---|---|
| committer | Michael Brown | 2007-07-08 23:02:45 +0200 |
| commit | ed20fee0cfc5863b308d22abc17a7dbb4327c90f (patch) | |
| tree | fb8e1e681415d19cfa127fb8a46f4664c862210c /src/core | |
| parent | Limit xmit window to one MTU. (Path MTU discovery not yet (diff) | |
| download | ipxe-ed20fee0cfc5863b308d22abc17a7dbb4327c90f.tar.gz ipxe-ed20fee0cfc5863b308d22abc17a7dbb4327c90f.tar.xz ipxe-ed20fee0cfc5863b308d22abc17a7dbb4327c90f.zip | |
Make ref_get() return the reference, for cleaner code.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/refcnt.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/refcnt.c b/src/core/refcnt.c index 36b7ce22a..30bb6deac 100644 --- a/src/core/refcnt.c +++ b/src/core/refcnt.c @@ -29,18 +29,18 @@ * Increment reference count * * @v refcnt Reference counter, or NULL + * @ret refcnt Reference counter * * If @c refcnt is NULL, no action is taken. */ -void ref_get ( struct refcnt *refcnt ) { +struct refcnt * ref_get ( struct refcnt *refcnt ) { - if ( ! refcnt ) - return; - - refcnt->refcnt++; - - DBGC2 ( refcnt, "REFCNT %p incremented to %d\n", - refcnt, refcnt->refcnt ); + if ( refcnt ) { + refcnt->refcnt++; + DBGC2 ( refcnt, "REFCNT %p incremented to %d\n", + refcnt, refcnt->refcnt ); + } + return refcnt; } /** |
