diff options
| author | Karel Zak <kzak@redhat.com> | 2012-12-04 14:22:39 +0100 | 
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2012-12-04 14:22:39 +0100 | 
| commit | ba2bdf41c436640286df40529cddede46b3ba5d8 (patch) | |
| tree | 2fd343c6a2450b4566ca996ff2f0c9703bc2e680 /libmount/src/iter.c | |
| parent | f4388dea5f8685149ca370279760b83cc98ccb7e (diff) | |
| download | util-linux-ba2bdf41c436640286df40529cddede46b3ba5d8.tar.gz | |
libmount: clean nonnull attribute usage
 - use __attribute__((nonnull) for functions where we not able to
   return an return code ("is", "has" and some "get" functions).
 - use __attribute__((nonnull) for small functions where we
   always modify any of the function argument (some mnt_optstr_* functions)
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/iter.c')
| -rw-r--r-- | libmount/src/iter.c | 15 | 
1 files changed, 5 insertions, 10 deletions
| diff --git a/libmount/src/iter.c b/libmount/src/iter.c index 393c23eb..d7b8adbe 100644 --- a/libmount/src/iter.c +++ b/libmount/src/iter.c @@ -54,25 +54,20 @@ void mnt_free_iter(struct libmnt_iter *itr)   */  void mnt_reset_iter(struct libmnt_iter *itr, int direction)  { -	assert(itr); - -	if (direction == -1 && itr) +	if (direction == -1)  		direction = itr->direction; -	if (itr) { -		memset(itr, 0, sizeof(*itr)); -		itr->direction = direction; -	} +	memset(itr, 0, sizeof(*itr)); +	itr->direction = direction;  }  /**   * mnt_iter_get_direction:   * @itr: iterator pointer   * - * Returns: MNT_INTER_{FOR,BACK}WARD or negative number in case of error. + * Returns: MNT_INTER_{FOR,BACK}WARD   */  int mnt_iter_get_direction(struct libmnt_iter *itr)  { -	assert(itr); -	return itr ? itr->direction : -EINVAL; +	return itr->direction;  } | 
