[PATCH 0/3] ata: remove dead checks and redundant code
From: shao.mingyin
Date: Wed Nov 04 2026 - 08:27:02 EST
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@xxxxxxxxxx>
---
base-commit: 7649ba73f9e7e1e04d0b46213e39c79ae09dd55c