[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <en2sbqjmqvo5ka5l5wz4qgqmiv3ivjy7zsjtwc3cgi7nlcgkv7@kuammu3tbjez>
Date: Wed, 14 Feb 2024 18:48:00 +0100
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: Raag Jadav <raag.jadav@...el.com>
Cc: jarkko.nikula@...ux.intel.com, mika.westerberg@...ux.intel.com,
andriy.shevchenko@...ux.intel.com, lakshmi.sowjanya.d@...el.com, linux-pwm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/5] pwm: dwc: drop redundant error check
Hello,
On Mon, Feb 12, 2024 at 06:32:44PM +0530, Raag Jadav wrote:
> pcim_iomap_table() fails only if pcim_iomap_regions() fails. No need to
> check for failure if the latter is already successful.
>
> Suggested-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Signed-off-by: Raag Jadav <raag.jadav@...el.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> drivers/pwm/pwm-dwc.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c
> index a4a057ae03ea..b9e18dbf7493 100644
> --- a/drivers/pwm/pwm-dwc.c
> +++ b/drivers/pwm/pwm-dwc.c
> @@ -50,10 +50,6 @@ static int dwc_pwm_probe(struct pci_dev *pci, const struct pci_device_id *id)
> }
>
> dwc->base = pcim_iomap_table(pci)[0];
> - if (!dwc->base) {
> - dev_err(dev, "Base address missing\n");
> - return -ENOMEM;
> - }
As just written in reply to v2, I'd like to have a comment here saying
that pcim_iomap_table() won't fail after pcim_iomap_table() to prevent
someone sending a patch that undoes this change with the reasoning that
pcim_iomap_table()'s return value should be checked.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists