staging: ks7010: rewrite hif_align_size inline function
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Fri, 6 Apr 2018 12:37:43 +0000 (14:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Apr 2018 12:27:35 +0000 (14:27 +0200)
This commit rewrites hif_align_size inline function to
improve readability. It also change parameters and return
type from int to size_t which is the correct and the one
which is being used when this function is called from
several points of the code.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_hostif.h

index 9cc265f..05ff5ca 100644 (file)
@@ -561,11 +561,9 @@ int ks_wlan_hw_power_save(struct ks_wlan_private *priv);
 
 #define KS7010_SIZE_ALIGNMENT  32
 
-static
-inline int hif_align_size(int size)
+static inline size_t hif_align_size(size_t size)
 {
-       return (size % KS7010_SIZE_ALIGNMENT) ? size + KS7010_SIZE_ALIGNMENT -
-           (size % KS7010_SIZE_ALIGNMENT) : size;
+       return ALIGN(size, KS7010_SIZE_ALIGNMENT);
 }
 
 #endif /* __KERNEL__ */