On 19/01/16 11:31, Andy Shevchenko wrote:
There are places where DIV_ROUND_UP() functionaly is open coded. Replace it by
macro call.

Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com>

Much nicer!

Acked-by: Martyn Welch <martyn.we...@collabora.co.uk>

---
  drivers/usb/serial/cp210x.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 9b90ad7..a45596de 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -338,7 +338,7 @@ static int cp210x_get_config(struct usb_serial_port *port, 
u8 request,
        int result, i, length;

        /* Number of integers required to contain the array */
-       length = (((size - 1) | 3) + 1) / 4;
+       length = DIV_ROUND_UP(size, 4);

        buf = kcalloc(length, sizeof(__le32), GFP_KERNEL);
        if (!buf)
@@ -383,7 +383,7 @@ static int cp210x_set_config(struct usb_serial_port *port, 
u8 request,
        int result, i, length;

        /* Number of integers required to contain the array */
-       length = (((size - 1) | 3) + 1) / 4;
+       length = DIV_ROUND_UP(size, 4);

        buf = kmalloc(length * sizeof(__le32), GFP_KERNEL);
        if (!buf)

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to