From nobody Tue Feb 10 03:57:28 2026 Received: from out203-205-221-173.mail.qq.com (out203-205-221-173.mail.qq.com [203.205.221.173]) (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 725C722DFA5 for ; Thu, 18 Dec 2025 03:19:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.205.221.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766027955; cv=none; b=LyK/RwSkyMDtK9oEuAP6rARRS9NzG7cTlbmLa7nwzcNpPmj9lpeUSgrfNaUIZkaMn7bvwkfDQqIdzsvHLuzzG+fnJBDLcNYkSheqaskSRy86t+v8Vbg+DFwx+A7umw/QO/ChmTCOiufzVruR5tv8+8bfpInTfw6/PXLceWHc0yo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766027955; c=relaxed/simple; bh=9uO5uHknpjw2O6Yndfo//m2nJZ1Whd0/2skvp9owF8o=; h=Message-ID:From:To:Cc:Subject:Date:MIME-Version; b=knPcvkdCUbgFI+aze6hCn1VzLUbBuKN5HBSQoCQwmRVThDH/NQPTCT3k9PB7pZlHqCJ/CcuEdViQ9apXRk6VQUjhPxsQBrjcH/RH6KPCIEUOvCGTffHUAtbctFuJLj4hTQ1I6iJq2UaFwkGnyGCjk9k4v8VZbSrn3EkMv5iKtmM= 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=qJpbR5aa; arc=none smtp.client-ip=203.205.221.173 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="qJpbR5aa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1766027941; bh=bAdcmA8CvwRhTQpBhq5+riI/wTamEHCQOUhPZkS0JVc=; h=From:To:Cc:Subject:Date; b=qJpbR5aaiLvyf4ICBNaZ7MebR31Ypy/BUh1J0FDsNNF2Iibg2FKnC9fhHy0YXqDpk vMYmeKQxcfwEcnU18vH75VWUoyXwHjawRYFGlkirZPnYVb/e5Xk1jGpYb47TpFRhfL cuwiLOuYBgQXws7MIpZl1BHXVcYkgin85CUeMslI= Received: from meizu-Precision-3660.meizu.com ([14.21.33.152]) by newxmesmtplogicsvrszb51-0.qq.com (NewEsmtp) with SMTP id 4BB1741C; Thu, 18 Dec 2025 11:18:59 +0800 X-QQ-mid: xmsmtpt1766027939tkg226rvk Message-ID: X-QQ-XMAILINFO: ON4JYNczNu10xLni2mZ47bEz3+euTrmIk4DBqL8MooDVnGqNfWNTJ8Z/GrBizZ 1l0Jr5nv8kMMLat8zGlknmpHHM0Dw212Z+H1G1so/4CrSWsyeZ3QjLGI+ubdv2a7i9O3eo9Gw4NV 4bgMj5z5N05CfkRDjlGMMW7wavlAhRkMT/Tg1INdp6o7bS6I+kIHynn3uSn9LEXyDRvVr1xIhlCy WD307IFVGSCLnRNFiMQH+omgEiYbzH+uccohqqy9cFCnXHsBCi3s0KMFuh0WEjN74P7G8Z6bhlsn 4EmhAzsjQisEuV8gaAyZJuS29VSg4iFhhlcm68/e/z17aroeIhE93hhnqgBX3n2c1/Dh+GRsDu8M e7MAn6fS40VAazxOTfL0EpFs4xv52pPsQzZfk3WsFGQPcFqmrgyy2vBdqmwUhMjxAvzvjcVdmHuG TpixJ8C/ChencTa56eByrOOY2XnLNy10KOYfnYnyzRwAw7LOnoN0XlovwKmcrL43Fwu8LFnkcUwz Pp7KZU4k3dg3tp8qvcVGUobkBqnn7UGt9xG7YocyL0x5dH372XBu+2iEW+tfIFKJkMWt2acUYii7 yAKkECY+TAcr6f8cRG5Yjz7Wmyy5GDClxBNE5y9+XxFQ7VExQ+TDikaDcatuOx0XbIJWE3bS8Ap8 OHdQHBGv9XZBrGtE99y5iezLe6oTgkAEGJAGIimlfGKAS6kwsGBpZLW6Kf/oB9wZb26t4WGo1LTN hwgkAz/oLBv7zOH+s8g8uxDB5zKifJ4R4MD3P+CuCdbFMkilh11cWkjCFZZGN/4FRzX0CQBktk+G u9HoRCU9j9cIglte4Q7kZFgaioGe1r5APEJi3lSElE3nUM5/D7+drqsDmKuw5xPadoDaLlOJSe9r IHW0TGj7MOYo5s5me6BQYKUjS1v74GbTSLrt7h0ZpBH2es7b8mRzEpSWihmbIB322LopQn+NqRfh IizOXiEVs+ZbojZh8jAfiyLnNOaalMovC4v/aXMDY9HAHEO13WI+QnlQsI+K6S8VSJXKJ/v3ZMhJ WtJn4AEC0E4PvSuh6MP7QY5q5V7zPFnYjwHOGtbOQHQWJAIxsda7DPkcfGa8119Q6R2Q8FKg== X-QQ-XMRINFO: MPJ6Tf5t3I/ycC2BItcBVIA= 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] erofs: print the names of unsupported compression algorithms Date: Thu, 18 Dec 2025 11:18:58 +0800 X-OQ-MSGID: <20251218031858.2864347-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 --- 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..866bd9158615b 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(Z_EROFS_COMPRESSION_RUNTIME_MAX =3D=3D ARRAY_SIZE(erofs_deco= mpressors)); =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