From nobody Sat Jul 25 16:44:51 2026 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BBCD2F7F07 for ; Wed, 15 Jul 2026 22:02:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784152932; cv=none; b=QVfRtAVEcnn1hFjTUwfbXiePT59a8dbb0MtySA7aAwjUSl+CkaFs63Q6t7EL6Wjx2S4FMtxYGjQ9ZyctzSebxTWvfNpFfZWDtShSzy7tJyY+exkOcTqucZcQ4/+lF1ZwPtBmPksX5YW8UV2PnqNAbF7/ffSXj5oPZv3yNF57Prw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784152932; c=relaxed/simple; bh=hXccJTGkDogFq9xNnd2HhyQ0ZplziOGnAqlX+J2y+Xc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lnPm9tGezymWmvkv5ZqN41Lx31SXk5QH3jXd90s0e6SxodQzHnSdHBPWqVJ70ne6TlzlWP1kiwy1I68mF9lgRwbMA7md2cRF43/OELEsduQaNex5ccnXp3iPT4EWqQQ8oY1fZuw6IPczuGS3tY09PkZXnWz0JW4y357BjONVndQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=S77IXi1b; arc=none smtp.client-ip=209.85.222.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="S77IXi1b" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-92e622cc874so409351785a.0 for ; Wed, 15 Jul 2026 15:02:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784152929; x=1784757729; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to :content-type; bh=NvWacIrRt+twzRaS74wAVnv31KXtCgTOGubOP/O81X8=; b=S77IXi1bAVI6aX9OILWUPteCXYJNFgbfOpgd7Ck25143wN3Tg9JBA4t7a/My3B6RWD SncurGkXjMHLJiCpJAFznMiiR+EtdapvxRHN7d8Nn9DagbsEL0Z2k9eAua81vIj7ns95 dkLQRn88xEWTEgqXrE/xDYg0UuhC5LBXF1kaMMPEhxY6Uq2LM40wgAWKxeN/k9hkQ/8V Tz60Oq9D1McCUVAA+5nhR40SHrAR2qK9bsbA4Yyw00DSn0iVJYtH+bgty/EY+sQq31q1 Y+bYkVEsG2hwxFJTrhzF2YbAw/pyxInJpviZB5Vrfj+QXWFy120YMjPoYukce2GGk/Dn dyYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784152929; x=1784757729; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=NvWacIrRt+twzRaS74wAVnv31KXtCgTOGubOP/O81X8=; b=P3jIpSgCKS5L/MIuA+pwHBIPjMD9wyh/2QWN7E/Q4h/QAOdvoX0nMPfG42Q5il8Z+P ZHFBAMe5CRcs5L1gbZrUAw65YQqx0Lmg4k42T9UmFWBwQoLBc7dhKud1I3IT9tLT7+SG Fo7cgFGPM31tXh7FY0dpeU4hPwVIL/hewD5K1ObCHvjt7qayElBZG6AXprZSAE392iA4 j27Xk0kNzhMICh4MFDp2sIiHpVF+PKVIYhyENVOZBHiCEDXpO8rsooa5R9IMHqbOa/Oj S0qVX04MM/jaqnODo/sKhbcA8xMYcFA6LjJgkKung2g49GRlhXOhpVrmfE11UapJu8GB FDHA== X-Forwarded-Encrypted: i=1; AHgh+RrBKBBkhWQKPdHRHP6bTqRH4NEcgHtc6aUEX37kkKmQDpPrJRrbCDwRdOOBXgQ6LOv1gjryjfyhboMlt4w=@vger.kernel.org X-Gm-Message-State: AOJu0YzjJyVN/hNyRDuAhUnSffhSuOSXh1XmgFX0/QVgHx5pgw4DzHhN pQ9QeRoS7UtGS7y+7HRFuBRTBI5saNDaZ1LVReNGdkYlTEEb73wE3+Xf X-Gm-Gg: AfdE7cm9EYEBbNEvqZcs0ckYj7b8yhcnsj2/X650ho1cp6AU5M5M7TV/0EAhMt5zneZ P4GOXZkLqxFxECnb9lyavCAcvl+ySkaZgeJELymgyvbU5THZ+MiTUU8by+2C9wn5L78TnUPLcny wAmrCF9B/36tApjCx8SmbCUDhLwc14tMNVVFlGTgqXQyVnQz20W+7pGG+RO7X5NDDpqqJRNpVg2 N6eJU4pAITrsBNrgoOkzjkn2mF2crMft6h53oBRRPB26LtBMujJyFkpXfk2kRgrLGxsbnkIfnzh q3UnnnzI++UJMJM+Blu+e9QlycOn7PMSdOpwIl5DZrshq0VLfSqv0ClLXzQJl9kLS6+mznbpf0w bEvhJPRAJwWTxUcOGRwSXL/BueHZMa/jcdCWmShda+IseQ9qUIclmvLY8GcFr93/0I+d8GjiMhF eZwVbRh+OFLIguRYFU1Ec7kjOKgggiPJlDZQdfvgT9PQ== X-Received: by 2002:a05:620a:459f:b0:930:a50a:4b39 with SMTP id af79cd13be357-930a50a4d12mr31029485a.75.1784152928660; Wed, 15 Jul 2026 15:02:08 -0700 (PDT) Received: from nixos-office ([2607:fb91:1cc6:ee9:3c58:cb8d:fd13:5294]) by smtp.gmail.com with ESMTPSA id af79cd13be357-92ee5d34f76sm1860910685a.35.2026.07.15.15.02.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 15:02:08 -0700 (PDT) Sender: Julian Braha From: Julian Braha To: nathan@kernel.org, nsc@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org Cc: arnd@arndb.de, stefan.hengelein@fau.de, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, nico@fluxnic.net, officialnaumansabir@gmail.com, rdunlap@infradead.org, vegard.nossum@oracle.com, kees@kernel.org, tj@kernel.org, Julian Braha Subject: [PATCH] Documentation: warn users not to use select on choice options in Kconfig Date: Wed, 15 Jul 2026 23:01:49 +0100 Message-ID: <20260715220149.48700-1-julianbraha@gmail.com> X-Mailer: git-send-email 2.54.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" Hengelein's master thesis about Kconfig from 2015 wrote that 'select' does not work on member options inside of a 'choice'. So I've re-implemented his check as part of kconfirm: https://github.com/julianbraha/kconfirm and discovered several instances of these dead selects in use, and fixing them is not always trivial. For example, see: https://lore.kernel.org/all/a3b7a752-8cc4-492a-bb62-43121b852c41@app.fastma= il.com/ Let's add a warning to the documentation (a place where developers are more likely to see it than a master's thesis...) Signed-off-by: Julian Braha Reviewed-by: Kees Cook --- Documentation/kbuild/kconfig-language.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/kbuild/kconfig-language.rst b/Documentation/kbui= ld/kconfig-language.rst index d9338407c1c6..ab2822d7ca1c 100644 --- a/Documentation/kbuild/kconfig-language.rst +++ b/Documentation/kbuild/kconfig-language.rst @@ -164,6 +164,11 @@ applicable everywhere (see syntax). That will limit the usefulness but on the other hand avoid the illegal configurations all over. =20 + select should also not be used on the member options of a choice. + Selecting a choice option will do nothing (dead code). Instead, + consider making these a dependency, or using the defaults of the + choice to enable the member option when it's needed. + If "select" is followed by "if" , will be selected by the logical AND of the value of the current menu symbol and . This means, the lower limit can be downgraded due to the --=20 2.54.0