From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Colin Ian King <colin.i.king@gmail.com>, linux-ide@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ata: pata_ali: remove redundant return statement
Date: Thu, 13 Jan 2022 08:52:09 +0900 [thread overview]
Message-ID: <2d9b4f08-967e-6040-a954-e7bfa7e4dce1@opensource.wdc.com> (raw)
In-Reply-To: <20220112234741.1232858-1-colin.i.king@gmail.com>
On 1/13/22 08:47, Colin Ian King wrote:
> A return statement is unnecessarily complicated, currently value
> in variable mask is bitwise-masked and the variable is being
> updated and then returned. Just updating the mask is all that is
> required as the following statement is a return.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> drivers/ata/pata_ali.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
> index ab28a6707b94..1b90cda27246 100644
> --- a/drivers/ata/pata_ali.c
> +++ b/drivers/ata/pata_ali.c
> @@ -123,7 +123,7 @@ static unsigned long ali_20_filter(struct ata_device *adev, unsigned long mask)
> mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
> ata_id_c_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num));
> if (strstr(model_num, "WDC"))
> - return mask &= ~ATA_MASK_UDMA;
Yeah, not to mention that is really ugly as the return should really
have been:
return mask & ~ATA_MASK_UDMA;
> + mask &= ~ATA_MASK_UDMA;
> return mask;
> }
>
Will queue this up.
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2022-01-12 23:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-12 23:47 Colin Ian King
2022-01-12 23:52 ` Damien Le Moal [this message]
2022-01-13 0:11 ` Colin King (gmail)
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=2d9b4f08-967e-6040-a954-e7bfa7e4dce1@opensource.wdc.com \
--to=damien.lemoal@opensource.wdc.com \
--cc=colin.i.king@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome