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.paracuel...@gmail.com>
---
 drivers/staging/ks7010/ks_hostif.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.h 
b/drivers/staging/ks7010/ks_hostif.h
index edbae62..a2e4a1b 100644
--- a/drivers/staging/ks7010/ks_hostif.h
+++ b/drivers/staging/ks7010/ks_hostif.h
@@ -650,11 +650,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__ */
-- 
2.7.4

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to