[PATCH v3 08/16] staging: ks7010: rewrite hif_align_size inline function
Sergio Paracuellos
sergio.paracuellos at gmail.com
Fri Apr 6 12:37:43 UTC 2018
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 at 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
More information about the devel
mailing list