mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <shao.mingyin@zte.com.cn>
To: <dlemoal@kernel.org>, <cassel@kernel.org>, <hansg@kernel.org>,
	<linux-ide@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH 0/3] ata: remove dead checks and redundant code
Date: Wed, 4 Nov 2026 21:14:32 +0800 (CST)	[thread overview]
Message-ID: <20261104211432688UOs4v84BESagMmLFH30Er@zte.com.cn> (raw)

This series removes two checks that the surrounding code already
guarantees and folds five duplicated cleanup paths in
zpodd_get_mech_type() into one.  It was found while reading libata.
There is no functional change intended; every patch is independent and
can be applied on its own or as any subset.

Patch 1 drops a test that is constant-false at compile time.
SATA_PMP_GSCR_DWORDS is 128, so "SATA_PMP_GSCR_DWORDS & 3" is zero and
the loop already terminates every fourth dword with a newline.

Patch 2 drops a dead rc check in ahci_platform_get_resources().  The
branch is only entered when IS_ERR() is true, so PTR_ERR() is negative
and "rc != 0" always holds.

Patch 3 rewrites zpodd_get_mech_type() to use one exit label instead of
five "kfree(buf); return ..." pairs.

Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
base-commit: 7649ba73f9e7e1e04d0b46213e39c79ae09dd55c

             reply	other threads:[~2026-11-04 13:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 13:14 shao.mingyin [this message]
2026-11-04 13:14 ` [PATCH 1/3] ata: libata-transport: drop the dead GSCR newline check shao.mingyin
2026-11-05  3:12   ` Damien Le Moal
2026-11-04 13:14 ` [PATCH 2/3] ata: libahci_platform: drop the dead error check shao.mingyin
2026-11-05  3:12   ` Damien Le Moal
2026-11-04 13:14 ` [PATCH 3/3] ata: libata-zpodd: use a single exit in zpodd_get_mech_type() shao.mingyin
2026-11-05  3:13   ` Damien Le Moal

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=20261104211432688UOs4v84BESagMmLFH30Er@zte.com.cn \
    --to=shao.mingyin@zte.com.cn \
    --cc=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=hansg@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

all inboxes | Powered by JetHome®