diff options
author | H Hartley Sweeten | 2016-04-20 19:36:42 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2016-04-29 07:18:51 +0200 |
commit | 7024cc88bf80644c50d125a47ae5ab6b7f675216 (patch) | |
tree | db4465feb965faec0baa2376976bb56532b8b68a /drivers/staging/comedi | |
parent | staging: comedi: mite: document the mite_struct spinlock_t (diff) | |
download | kernel-qcow2-linux-7024cc88bf80644c50d125a47ae5ab6b7f675216.tar.gz kernel-qcow2-linux-7024cc88bf80644c50d125a47ae5ab6b7f675216.tar.xz kernel-qcow2-linux-7024cc88bf80644c50d125a47ae5ab6b7f675216.zip |
staging: comedi: mite: remove BUG_ON() in MITE_IODWBSR_1_WSIZE_bits()
Prior to calling this function pci_ioremap_bar() is called. If the
pci_resource_len(), i.e. the 'size', was 0 the ioremap would fail
so this function would never be called. So the first BUG_ON() can
never occur.
The 'order' returned by ilog2() will always be > 0 so the second
BUG_ON() will also never occur.
Remove the unnecessary BUG_ON() checks and tidy up the function.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/mite.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/staging/comedi/drivers/mite.c b/drivers/staging/comedi/drivers/mite.c index d5475cd89d1e..2233a412cf26 100644 --- a/drivers/staging/comedi/drivers/mite.c +++ b/drivers/staging/comedi/drivers/mite.c @@ -157,12 +157,7 @@ static unsigned int MITE_IODWBSR_1_WSIZE_bits(unsigned int size) { - unsigned int order = 0; - - BUG_ON(size == 0); - order = ilog2(size); - BUG_ON(order < 1); - return (order - 1) & 0x1f; + return (ilog2(size) - 1) & 0x1f; } static unsigned int mite_retry_limit(unsigned int retry_limit) |