Re: [PATCH 07/10] staging: ozwpan: Use slab cache for oz_urb_link allocation

From: Dan Carpenter
Date: Tue Aug 05 2014 - 07:18:53 EST


On Mon, Aug 04, 2014 at 02:54:53PM +0200, Christoph Jaeger wrote:
> @@ -2341,6 +2289,11 @@ int oz_hcd_init(void)
>
> if (usb_disabled())
> return -ENODEV;
> +
> + oz_urb_link_cache = KMEM_CACHE(oz_urb_link, 0);
> + if (unlikely(!oz_urb_link_cache))
> + return -ENOMEM;

Don't put unlikely() calls in driver code. It just makes it messy for
no reason. "Oooo! I can modprobe/rmmod this driver 1000000 times in a
row and it speeds it up .0003 seconds because I added an unlikely tag!"

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/