Re: [PATCH] pcmcia/cm4000: remove useless variable tmp

From: Arnd Bergmann
Date: Tue Jan 21 2020 - 04:08:33 EST


On Tue, Jan 21, 2020 at 9:50 AM Alex Shi <alex.shi@xxxxxxxxxxxxxxxxx> wrote:
>
> No one care the value of 'tmp' in func cmm_write. better to remove it.

Hi Alex,

> @@ -1146,7 +1145,7 @@ static ssize_t cmm_write(struct file *filp, const char __user *buf,
> set_cardparameter(dev);
>
> /* dummy read, reset flag procedure received */
> - tmp = inb(REG_FLAGS1(iobase));
> + inb(REG_FLAGS1(iobase));

I think this may cause warnings on some architectures, when inb() is a macro
that just turns into a pointer dereference. You could write it as

(void)inb(REG_FLAGS1(iobase));

which would not warn anywhere.

Arnd