[PATCH v2 08/16] staging: ks7010: rewrite hif_align_size inline function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <sparacuellos@xxxxxxxxxxxxx>
---
 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
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux