From nobody Tue Apr 7 06:32:58 2026 Received: from out162-62-57-210.mail.qq.com (out162-62-57-210.mail.qq.com [162.62.57.210]) (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 0E2651A6819 for ; Sun, 15 Mar 2026 08:53:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.62.57.210 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773564817; cv=none; b=ASzc67e1JUpch6bt7BZtmWOYTvtzPTdQwyY+YxJjwXz5BbS2nzSATZwjZDER2VtW2wHEX5HaqmaQRRCX4MNR16KRnObZN92/D/RUdJmSiEQB/zIfZIxg1QlaxYiKCSUijhX5rWJ5ifnTLSwJYlemRqdmqhcTpaQO8qTGZVMBRIU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773564817; c=relaxed/simple; bh=DfQjHDs4eJB1GxSqiWP5IlicpgjzoGRtuV+h0Wa3yaU=; h=Message-ID:From:To:Cc:Subject:Date:MIME-Version; b=Cpb/xrqdRppA/KcBLQvIWr8gJk04ucIzig0h4H5Fetykh/OpYwOQMWXKa98ciO+Ym2oSwgnEG3w8zAw6KCkyPNJvFIIdnQJplOT613tkfABCwv8+fnKgmIazbEQLzYtmtqsXM0OrEnVOvg5fBdzL8JFZYUVf0url+wV2q80kHfk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com; spf=pass smtp.mailfrom=qq.com; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b=NpVjlGdP; arc=none smtp.client-ip=162.62.57.210 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qq.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b="NpVjlGdP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1773564803; bh=2+YLCeKoMn1SskCcdsXXN6ly4OPnuHYBlBfVUfIQB9U=; h=From:To:Cc:Subject:Date; b=NpVjlGdPss110eUEM6A4mhc7Zj0cOL/qkBubuvPpNyZ0xeuTrJpvHo14fwXhNLnd8 AxXwBDMuxwuPkZbMMI6iBOqDpWIe9ADH/33+6nsSkTkHlOTclb7Q4ze/OeHO6Ytjh1 nf//XdKXAEuqKAO5+vLFk0L23tmLc8Mq9lq6kezQ= Received: from JTY-Laptop.localdomain ([2409:8a38:c32:6d40:51b7:3b35:bc94:4ade]) by newxmesmtplogicsvrsza56-0.qq.com (NewEsmtp) with SMTP id D56072A5; Sun, 15 Mar 2026 16:53:22 +0800 X-QQ-mid: xmsmtpt1773564802td7d0y6jj Message-ID: X-QQ-XMAILINFO: M1rD3f8svNzn4OBdZ15BjKqP/qUuwIvr6g64kMumGzkkWB7xv1M4mUYTvCeLV3 U3g/LY4FvQh05moLMEoP6RHu98KvnVoIUDBauNJUGOEseH1j7EYc3pWmvtlAql5eC3RcWx2SbJ8m 8Ind0i3efyqHvTl7qYQjvbZbHskNI9YSNJuty7eCcRje/F+chg4A1UB+TubcxqrwcoZ+DrSyusGc TiUKXXciZRKJAiHXEPW/rnoMCTTNIY1zlWnx+zpn3EtgoWXHG0s6HId6Bqt1DRxYWWQW9yh6J0eK WTEFC1jn3mhpgROuIgxAHPGXHp9SLzNY+naUAj44OhXYHvgCvC9MB2pEX7DSg3E+ZyPHt7Lhjb3J baALzIK6CZSYTjyTC+6D7o8bJc8blqgWH80ocKLTaDEefqSsJYBOAQzT3RvZEbuFl4HrVQZz1Ppn SHv6lnmVmjRH+STLTnIY/mGsuZi6iqucIw5/psO1bZ6ihIumIWmRhW79egSUmuzE73HwcgMv2W0k H1kxPTE6CQ6WGIADF5mwJZG7L3oDNpjlF7wsMvCtz12v4hXPhG9V0SNYmEE/720g43VS9nNeDevE foPOlhpnLrF7Op5qNLFOYi2bLKQ5GLabezeIC1AcBo8Ow4o7o3NM957HxFNuGr8TUHxPWXpUZfQU +LOjQTTqhLWCzq2Ke0LuYAkLL6ixZcawAY6G2kJSEphPc6Si4ugFtqKhR3b7bD7t6Ic43catNEQb tdPDXNXcK1oEHnwUsXK0iHLHY9Ota3m2IAT0ZuiS+o1o+TGECb5XGV98gatfaXzrezDiFSVM2R/r MC1P7V+ijT0gjOYSiMHoP6Hm88D2rrouI5q3DpYxRGqyBAE6wAZf0y0HkVkxw1TdweSTMVKAdZKl A7yY+tU76czQd8n5FeMqJNho/0wfsZitHIlQt+Nc9dTxXUe9y5FQARY95SJEbH+/3ICpK4Qxqrve MdjBVg5C/fWnnHZ6u5E50YM+Ca+gM1QHjEuHxTj4vPtJT49HWQKHbzL80pwnDO/jYzbdxu7F0DFi MGHF7xxeDFAdY/b7+auwgNhwzZKKSCTOmssxMWoI3+nqyegEOd X-QQ-XMRINFO: MSVp+SPm3vtSI1QTLgDHQqIV1w2oNKDqfg== From: hamjin To: linux-kernel@vger.kernel.org Cc: hamjin Subject: [PATCH] lib: typecheck: initialize const variable to avoid Clang warning Date: Sun, 15 Mar 2026 16:52:48 +0800 X-OQ-MSGID: <20260315085248.653195-1-jinham@qq.com> X-Mailer: git-send-email 2.53.0 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" Building the kernel with newer Clang versions triggers -Wdefault-const-init-var-unsafe in the typecheck() macro: error: default initialization of an object of type 'const unsigned long' leaves the object uninitialized [-Wdefault-const-init-var-unsafe] The warning originates from the following declaration in typecheck(): typeof(x) __dummy2; When 'x' has a const-qualified type (e.g. 'const unsigned long'), Clang warns that the variable is declared const but not initialized. With -Werror enabled this causes the build to fail. Initialize the temporary variable to zero to silence the warning: typeof(x) __dummy2 =3D (typeof(x))0; This variable is only used for compile-time type checking and its value is never read, so the initialization has no functional impact on the generated code. Fixes: e0deaff47090 ("split the typecheck macros out of include/linux/kerne= l.h") Signed-off-by: hamjin --- include/linux/typecheck.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/typecheck.h b/include/linux/typecheck.h index 46b15e2aaefb..09f280da5b52 100644 --- a/include/linux/typecheck.h +++ b/include/linux/typecheck.h @@ -8,7 +8,7 @@ */ #define typecheck(type,x) \ ({ type __dummy; \ - typeof(x) __dummy2; \ + typeof(x) __dummy2 =3D (typeof(x))0; \ (void)(&__dummy =3D=3D &__dummy2); \ 1; \ }) --=20 2.53.0