aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8723bs/hal
diff options
context:
space:
mode:
authorWambui Karuga <wambui.karugax@gmail.com>2019-10-13 22:10:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-14 15:36:58 +0200
commit807411911d99fe13ade4c02db4606f2df672f589 (patch)
tree9947c5f3d99e0da526c06ef94e739925b81976ab /drivers/staging/rtl8723bs/hal
parentstaging: vc04_services: use DIV_ROUND_UP helper macro (diff)
downloadlinux-dev-807411911d99fe13ade4c02db4606f2df672f589.tar.xz
linux-dev-807411911d99fe13ade4c02db4606f2df672f589.zip
staging: rtl8723bs: use DIV_ROUND_UP helper macro
Use the DIV_ROUND_UP macro to replace open-coded divisor calculation to improve readability. Issue found using coccinelle: @@ expression n,d; @@ ( - ((n + d - 1) / d) + DIV_ROUND_UP(n,d) | - ((n + (d - 1)) / d) + DIV_ROUND_UP(n,d) ) Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Link: https://lore.kernel.org/r/20191013191027.6470-1-wambui.karugax@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8723bs/hal')
-rw-r--r--drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index 87535a4c2e14..22931ab3a5fc 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -4156,9 +4156,8 @@ void SetHwReg8723B(struct adapter *padapter, u8 variable, u8 *val)
break;
}
- /* The value of ((usNavUpper + HAL_NAV_UPPER_UNIT_8723B - 1) / HAL_NAV_UPPER_UNIT_8723B) */
- /* is getting the upper integer. */
- usNavUpper = (usNavUpper + HAL_NAV_UPPER_UNIT_8723B - 1) / HAL_NAV_UPPER_UNIT_8723B;
+ usNavUpper = DIV_ROUND_UP(usNavUpper,
+ HAL_NAV_UPPER_UNIT_8723B);
rtw_write8(padapter, REG_NAV_UPPER, (u8)usNavUpper);
}
break;