From nobody Mon Feb 9 10:50:03 2026 Received: from out203-205-221-155.mail.qq.com (out203-205-221-155.mail.qq.com [203.205.221.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 274532F659F for ; Thu, 18 Dec 2025 03:27:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.205.221.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766028464; cv=none; b=Bh2J1KRR+ipgGXlnfMAc1h5GZWXNrcnpiVzMVvg5S0CACCWKVZarAPNbpoxJVRznf5gwySKveb6W0bqCLF3lRDJWGMyC9EJ/okD7qiIMq6drQOhxv2zNujJx7jU8aHmFaz1P8dNLKT3jCyJIPa1QWtDrCLxjS/6zesRKRKDFkg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766028464; c=relaxed/simple; bh=fR+K5yzc5sNoc+YoGIAOkHELyPqJYM5LXxnUmR0CKKs=; h=Message-ID:From:To:Cc:Subject:Date:MIME-Version; b=mmjNDSSKLbR+sni6/cJO09cUSc2uOgtqb3RB9CMdhuM9I8l//ixS8jfnhdAhxe6MVKtpcirmc+VStdSQpwBAH+fXOh4dUavBMszw9dd3IeAA31pmmzx60Mju1Syf40yoqCfdfO7c13qZUQSNcFRY9UcmVAKsmzv4CclaDUns3JM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com; spf=pass smtp.mailfrom=foxmail.com; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b=CQBvarxL; arc=none smtp.client-ip=203.205.221.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foxmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b="CQBvarxL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1766028453; bh=o28QEsHhGcO7wQDXuYXlbUCSabm5UXZunnyQ5RtJ2S8=; h=From:To:Cc:Subject:Date; b=CQBvarxLrWZSPli15W3oiREZ2UJmn/J1wdt271Wmz2+uwog+f2CS7GgabBI93zfIW SC9s2rwccG4z5JpJ/03Ciss4Pw9DCjIv/kW5IPSK5P+eyHj3Wee7C0q2aabyyb+0zj 0JDaJvckgVDTx/9rD0MEJtdmLqAxc1IMVr5XsYGA= Received: from meizu-Precision-3660.meizu.com ([14.21.33.152]) by newxmesmtplogicsvrszc50-0.qq.com (NewEsmtp) with SMTP id 6DF8807C; Thu, 18 Dec 2025 11:27:31 +0800 X-QQ-mid: xmsmtpt1766028451ticvcafm4 Message-ID: X-QQ-XMAILINFO: Nte9/BsRzcszBFeLXhxxh18xc4dQYK4Bwnu3A3xEDO7VqjQZWP67FqdYr28SvW GR7bjJiw3SZBdyWjeyj6LQSLi8K9fKbPSQhaJOL7KfckOKe+cCaXagmqImVH8F+l6ZoErTbuuH8h hP5zirduLrOxTsyGuUPvEUTXKRZ5Z18QtuNKLY+rN4ps8baLC7TIQfljTc0f326Sg+UR0pL3znWB Qxy2WW1mmGYjhtxSwbnOvMQMp48XoWpd4o71a/YgzgADhMrHeSdJ+zs1BFr48bGq4HApd/Wg/Is8 I6wANZ146qZKuosPRuOv1iwvX+mvs2x+vfDy+DTETEc/MuhvPEhezs1tAMTVeGgv8ixRdT61NSHu IMeFCYXQLJ4qBV+gaFRsLsC5v84q60XzZGMLQTgsf4UAErHCSs+/t2Sh3aNRIQPjs7K9YsEAppjs fa9OsewUGvPpEfc7l8PngDDt+ynZ/XNl7cMrwIaCjGOxrBL33xTO6o3aM4kW5ugGkW8uWx2Kc2m1 2jF1Slqy8dIL9ENTAKe7SL7un2if20SxrOvISt06q+o0a49W2jdlSI3U/rc1xQVVQkvhAjxGoQzv p0byshylCg9CPGCEuLXm/Bc63coSYAh79kFGCl6l9oE9A4+2fKNkcPLcQNqufgmkE1047pl5CN5X 65yRw43p2shHYPcUlYA8F4stMFEImkxmkznJaACgm+2yHpUZAVc/NW5sTEUAm2QhrEB4EJjHB556 Gn2VrYKv3r+Kw2Q/Ccc8zgX93enX9AhqPm9nA2tatdyQbYABER+ITXMcE+KhBmLERraBGBiKO6WI 3pK2VcNgp1gqmPQl5jQE4iqNQrHTrtZdQexX7JRW16bML6TTknwSCF1+A3PyqX8U1nr8+jNECvqh 4gpsLsTyw3s8JwjtncDgsbNrIRgNKTUr/Lzzcgt95AU+3rxNBUpXCl7dFE8xvphiRR1XX8zgRH8D XBjN6SMWrMugvjmb3VbK1eBlJO6sslaYOwQJCdMovvbnclyH5fxvdjqv7iEE6BixffQA3Y5Xr5IP OisoHxCwGD4e8KBZNt6MfoP8ImBkRGVkhZVHI1NPQE9IfNzXQk50IxjYn/NfQ8ycw1v+ztQjGof/ Xz1PGsV4AQ4sx6lKk= X-QQ-XMRINFO: OD9hHCdaPRBwq3WW+NvGbIU= From: Yuwen Chen To: xiang@kernel.org Cc: chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, Yuwen Chen Subject: [PATCH v2] erofs: print the names of unsupported compression algorithms Date: Thu, 18 Dec 2025 11:27:29 +0800 X-OQ-MSGID: <20251218032729.2866825-1-ywen.chen@foxmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" After simplifying the implementation of z_erofs_parse_cfgs, the names of unsupported algorithms can now be directly output. Moreover, some unnecessary additional judgments can be removed. Signed-off-by: Yuwen Chen --- v1 -> v2: - fix the code style issues prompted by the checkpatch.pl script fs/erofs/decompressor.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c index be1e19b620523..f64b08fe81791 100644 --- a/fs/erofs/decompressor.c +++ b/fs/erofs/decompressor.c @@ -385,21 +385,22 @@ const struct z_erofs_decompressor erofs_decompressors= [] =3D { .decompress =3D z_erofs_lz4_decompress, .name =3D "lz4" }, -#ifdef CONFIG_EROFS_FS_ZIP_LZMA [Z_EROFS_COMPRESSION_LZMA] =3D { +#ifdef CONFIG_EROFS_FS_ZIP_LZMA .config =3D z_erofs_load_lzma_config, .decompress =3D z_erofs_lzma_decompress, +#endif .name =3D "lzma" }, -#endif -#ifdef CONFIG_EROFS_FS_ZIP_DEFLATE [Z_EROFS_COMPRESSION_DEFLATE] =3D { +#ifdef CONFIG_EROFS_FS_ZIP_DEFLATE .config =3D z_erofs_load_deflate_config, .decompress =3D z_erofs_deflate_decompress, +#endif .name =3D "deflate" }, -#endif }; +static_assert(ARRAY_SIZE(erofs_decompressors) =3D=3D Z_EROFS_COMPRESSION_R= UNTIME_MAX); =20 int z_erofs_parse_cfgs(struct super_block *sb, struct erofs_super_block *d= sb) { @@ -433,10 +434,9 @@ int z_erofs_parse_cfgs(struct super_block *sb, struct = erofs_super_block *dsb) break; } =20 - if (alg >=3D ARRAY_SIZE(erofs_decompressors) || - !erofs_decompressors[alg].config) { - erofs_err(sb, "algorithm %ld isn't enabled on this kernel", - alg); + if (!erofs_decompressors[alg].config) { + erofs_err(sb, "algorithm %s isn't enabled on this kernel", + erofs_decompressors[alg].name); ret =3D -EOPNOTSUPP; } else { ret =3D erofs_decompressors[alg].config(sb, --=20 2.34.1