From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Tang Bin <tangbin@cmss.chinamobile.com>
Cc: Mark Brown <broonie@kernel.org>,
Cezary Rojewski <cezary.rojewski@intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
Liam Girdwood <liam.r.girdwood@linux.intel.com>,
Jie Yang <yang.jie@linux.intel.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
ALSA Development Mailing List <alsa-devel@alsa-project.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ASoC: Intel: atom: Remove redundant check to simplify the code
Date: Tue, 30 Nov 2021 11:46:19 +0200 [thread overview]
Message-ID: <CAHp75VfS+u56RDG6AhGwSuB35ERUTjw-e3h05OZmZowstWJL8g@mail.gmail.com> (raw)
In-Reply-To: <20211125075028.8500-1-tangbin@cmss.chinamobile.com>
On Fri, Nov 26, 2021 at 2:37 PM Tang Bin <tangbin@cmss.chinamobile.com> wrote:
>
> In the function sst_platform_get_resources(), if platform_get_irq()
> failed, the return should not be zero, as the example in
> platform.c is
> * int irq = platform_get_irq(pdev, 0)
> * if (irq < 0)
> * return irq;
> So remove the redundant check to simplify the code.
FWIW,
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Code is correct, I haven't checked the rest, though.
> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
> ---
> sound/soc/intel/atom/sst/sst_acpi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c
> index 3be64430c..696d547c5 100644
> --- a/sound/soc/intel/atom/sst/sst_acpi.c
> +++ b/sound/soc/intel/atom/sst/sst_acpi.c
> @@ -226,8 +226,8 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
> /* Find the IRQ */
> ctx->irq_num = platform_get_irq(pdev,
> ctx->pdata->res_info->acpi_ipc_irq_index);
> - if (ctx->irq_num <= 0)
> - return ctx->irq_num < 0 ? ctx->irq_num : -EIO;
> + if (ctx->irq_num < 0)
> + return ctx->irq_num;
>
> return 0;
> }
> --
> 2.20.1.windows.1
>
>
>
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2021-11-30 9:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-25 7:50 [PATCH] ASoC: Intel: atom: Remove redundant check to simplify the code Tang Bin
2021-11-29 16:22 ` Pierre-Louis Bossart
2021-11-29 17:11 ` Mark Brown
2021-11-29 19:01 ` Andy Shevchenko
2021-11-29 19:05 ` Andy Shevchenko
2021-11-29 19:08 ` Mark Brown
2022-01-25 18:09 ` Andy Shevchenko
2021-11-30 9:46 ` Andy Shevchenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHp75VfS+u56RDG6AhGwSuB35ERUTjw-e3h05OZmZowstWJL8g@mail.gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=cezary.rojewski@intel.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=tangbin@cmss.chinamobile.com \
--cc=tiwai@suse.com \
--cc=yang.jie@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).