diff options
author | Bhaktipriya Shridhar <bhaktipriya96@gmail.com> | 2016-02-22 17:57:42 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-25 22:35:10 -0800 |
commit | dce57aef61ae49edf45df6fc09609e8da9b57265 (patch) | |
tree | 89f46efac622be7bf24616be0aa4839ce09ab42b /drivers/staging | |
parent | 3e8b9fe0602a25e37806e7b92408970da460b0e2 (diff) | |
download | linux-dce57aef61ae49edf45df6fc09609e8da9b57265.tar.bz2 |
staging: most: hdm-usb: Use macro DIV_ROUND_UP
The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)).
It clarifies the divisor calculations. This occurence was detected using the
coccinelle script:
@@
expression e1;
expression e2;
@@
(
- ((e1) + e2 - 1) / (e2)
+ DIV_ROUND_UP(e1,e2)
|
- ((e1) + (e2 - 1))/ (e2)
+ DIV_ROUND_UP(e1,e2)
)
The macro CEILING was dropped altogether and has been replaced with
DIV_ROUND_UP.
Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/most/hdm-usb/hdm_usb.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c index 3ee9e6f2f07e..9d5555de2e39 100644 --- a/drivers/staging/most/hdm-usb/hdm_usb.c +++ b/drivers/staging/most/hdm-usb/hdm_usb.c @@ -40,7 +40,6 @@ #define MAX_SUFFIX_LEN 10 #define MAX_STRING_LEN 80 #define MAX_BUF_SIZE 0xFFFF -#define CEILING(x, y) (((x) + (y) - 1) / (y)) #define USB_VENDOR_ID_SMSC 0x0424 /* VID: SMSC */ #define USB_DEV_ID_BRDG 0xC001 /* PID: USB Bridge */ @@ -786,7 +785,7 @@ static int hdm_configure_channel(struct most_interface *iface, int channel, temp_size += tail_space; /* calculate extra length to comply w/ HW padding */ - conf->extra_len = (CEILING(temp_size, USB_MTU) * USB_MTU) + conf->extra_len = (DIV_ROUND_UP(temp_size, USB_MTU) * USB_MTU) - conf->buffer_size; exit: mdev->conf[channel] = *conf; |