• Dan Carpenter's avatar
    rapidio: use resource_size() · 88cf81fc
    Dan Carpenter authored
    The size calculation is done incorrectly here because it should include
    both the start and end (end - start + 1).  It's easiest to just use
    resource_size() which does the right thing.
    
    I was worried there was something non-standard going on because the
    printk() subtracts "end - 1", but the rest of the file uses the normal
    resource size calculations.  This function is only called from
    fsl_rio_setup() in arch/powerpc/sysdev/fsl_rio.c and the calculation
    there is also:
    
    	port->iores.start = law_start;
    	port->iores.end = law_start + law_size - 1;
    
    So I think this is the correct fix.
    Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
    Cc: Alexandre Bounine <alexandre.bounine@idt.com>
    Acked-by: default avatarLi Yang <leoli@freescale.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    88cf81fc
rio.c 32.9 KB