s390/cio: fix length calculation in idset.c
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Tue, 6 Nov 2012 14:10:05 +0000 (15:10 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 6 Nov 2012 21:39:54 +0000 (22:39 +0100)
bitmap_or uses the number of bits as its length parameter and
not the number of words necessary to store those bits.

This fixes a regression introduced by:
aa92b33 s390/cio: use generic bitmap functions

Reported-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Acked-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/idset.c

index 199bc6791177491bea28b360845911a282b259b5..65d13e38803f9dddc11079b9a00176e7b94116d2 100644 (file)
@@ -125,8 +125,7 @@ int idset_is_empty(struct idset *set)
 
 void idset_add_set(struct idset *to, struct idset *from)
 {
-       int len = min(__BITOPS_WORDS(to->num_ssid * to->num_id),
-                     __BITOPS_WORDS(from->num_ssid * from->num_id));
+       int len = min(to->num_ssid * to->num_id, from->num_ssid * from->num_id);
 
        bitmap_or(to->bitmap, to->bitmap, from->bitmap, len);
 }