2022-04-25 05:57:58

by Maciej W. Rozycki

[permalink] [raw]
Subject: Re: [PATCH] FDDI: defxx: simplify if-if to if-else

On Sun, 24 Apr 2022, Wan Jiabing wrote:

> diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c
> index b584ffe38ad6..3edb2e96f763 100644
> --- a/drivers/net/fddi/defxx.c
> +++ b/drivers/net/fddi/defxx.c
> @@ -585,10 +585,10 @@ static int dfx_register(struct device *bdev)
> bp->mmio = false;
> dfx_get_bars(bp, bar_start, bar_len);
> }
> - }
> - if (!dfx_use_mmio)
> + } else {
> region = request_region(bar_start[0], bar_len[0],
> bdev->driver->name);
> + }

NAK. The first conditional optionally sets `bp->mmio = false', which
changes the value of `dfx_use_mmio' in some configurations:

#if defined(CONFIG_EISA) || defined(CONFIG_PCI)
#define dfx_use_mmio bp->mmio
#else
#define dfx_use_mmio true
#endif

Maciej