Re: [PATCH] fbdev: savage: remove unused variable

From: Tomi Valkeinen
Date: Tue Jan 13 2015 - 06:34:31 EST


On 06/01/15 15:12, Sudip Mukherjee wrote:
> vga_in8() was storing the return value in tmp, but that return value
> was never used again. so it should be safe to remove those variables.
>
> Signed-off-by: Sudip Mukherjee <sudip@xxxxxxxxxxxxxxx>
> ---
>
> just one doubt:
> vga_in8() is calling savage_in8() which is a readb().
> so in effect we are reading one byte from
> (par->mmio.vbase + 0x8000 + 0x3da) and then discarding that value.
> so if we are discarding that value then why we are reading it?

Sometimes reading a HW register without actually using the returned
value has some effect. I don't know if there's a reason for that in this
case, though, as I'm not familiar with the HW.

In any case, it's safer to keep the read there as you did.

Queued for 3.20.

Tomi


Attachment: signature.asc
Description: OpenPGP digital signature