From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) (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 42F3D28469F for ; Mon, 9 Mar 2026 16:52:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773075146; cv=none; b=QWHexMLx50ETyrH5esGW0HCeJsvq5fiWu+mB/P1QmxZ78vhAv3hEGRhY/cDrSegmmDacvuTr5bok1L2o+4yc+cXg718vOzID9+4sFamFeQ0EsouzNj99cfe/zCI6PdO2qjzVWSkkfsPXt50kZUIcPENDh2OsKllv8o2icUC18TY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773075146; c=relaxed/simple; bh=V/af1uS7ve+cxtfd+cPHvwl+thwG9mUmSyG08yuzdO0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=UrN3LpaVIiO0pPbOcPxxQdv370sg9qUnQZlQplRgx8EiK9gMKU0L+/5MhoSN792RFhmZjh8HwHtpzzcBia67jYC8vfNKFEjZXEoVEeyM6aYk9DM+4Ih2SI7QB8wsR1JutQWDyIfB+xN2J/nvvmIsZxCaktG/mVc/pmUWHcLbCF8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=drGOVtf8; arc=none smtp.client-ip=209.85.160.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="drGOVtf8" Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-40ea611d1a4so2609689fac.2 for ; Mon, 09 Mar 2026 09:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1773075143; x=1773679943; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=FKGwk4BfZsKX9Aedku1N+v19aYUy2V+hhO3FARDiAaM=; b=drGOVtf8Qw9Y76qUOnn98xaUqBMWlUgS0zSYoU/IG+OqiydPYNABYRTD+mkvjoXM1b YJ0e7IWcWW5zPYc7BcqXhvKl82Ti/2JwetmJYpwXk8JOKGWtbBlDWqGmoAEHjmMjcNbj WR7QKKHHEWxRIdCh1zl5JiR62CEY49Z7bRedp9cQI16uHZTk+HYZAUCCqY8G9sdJdg19 w6JxezaOIl5h+3bxsmuEVNXV0A6tHxOThxz7RfacjHdY8Pg3L1NqGFFlM04ugLpD0Wui tMHvQBHfUalaSUgj2DXKSFijILofXZ7f02qFQSNC9y2hx5KMvW49pbulnRxzEJBr0iiv mT6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773075143; x=1773679943; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FKGwk4BfZsKX9Aedku1N+v19aYUy2V+hhO3FARDiAaM=; b=cBwlpYG2yhNuQTajarUnDnqSgb4n2dIYh28JJR1MWGHTbGoGJ/yQKw52tAsVZCcLrH I641bWnVrOFbM5W8OYRSarseOIP3eCyjwPonmy3QqE41oR0n6SvAG2gpOa/fwu9WsZK9 OayZ3agBB6SZ7gGEO822XsQ97sqAocYILf9/77wn/regfz7QJgIRW0LeYTBNzNmbFFtF oidR72mHY4jWj0hXr48P2ChEHC5XwbB3no51OmERE5ilmQUBU0kLyf9z1wLBEwpO1mxI x6I+unhtudF6eJJH0gEzgwrmxMi/35TmpH7R6MFhk+lcbgt7Jt1Sx0J0rWJPThHw2x3Z L9bw== X-Forwarded-Encrypted: i=1; AJvYcCUKXsNHerl8o3gZ76QuGkWJaFGoBN04bT8yvwDIf95NbPqgHFIkXzWMXOdlNE02OZZrPonb5lBUyPHrTeU=@vger.kernel.org X-Gm-Message-State: AOJu0Yzk+Hz1YmhO6YO1FmuSOu/v0WrnVLSBYBspvRDyt8k5PrngmxG4 Xc1hr/l+1+Tn57Cl45C1CViu85LXxVl7n+xhCOoPHPDS9X8SLL3bUHWFaAhgz07yFyA= X-Gm-Gg: ATEYQzzPZygdupZnLG3zg2KMdEX7Ntpc07Q9nz18bp5Q/kqEBf6/covdeAryy3AUg2X O1Hfgd3vrNjufmjf1Hk5jZfJPkZXas6agbNO6j6O9XaaKyHFVy9wikDF8JdwyuSVO6Ua6h0u1Ub E+JwqPxWsSOdLDGR33YI3YujcAMb03catnqc/xRsjqE6XiBNGA7Spq/qHZ9xQtJj87lzdtQvBqW rMuFsxTDJalY1w3qwDDWZmzsYT3OceBfRqxq+aUmuSGM/VNnzO/+D+t7jAsbNUfhBLo8yXfUAMS CWRevYu65cunYs0YA1qtYcNSmc20rdZCMJssR0byYKP8WGuLjbb9PZ/NWbJgFcj37c3LGXkByz6 +M6d0F/fpO6qb/CNe6Yw8uHFln2/xbloes/ytSC+8tKiMn9kL2L/d6gIzVpkApHCkkc8ZmZgpn/ eQvM19ZinhH9AN6K1uasOwUUMAAmLjerWqaHz49HCJI9P6E7vA2uSuS4ZfPWa2d3V1jMqNSc3aX hhyTeQ= X-Received: by 2002:a05:6871:29d:b0:3f5:af84:8c65 with SMTP id 586e51a60fabf-416e45ab570mr6486239fac.55.1773075142965; Mon, 09 Mar 2026 09:52:22 -0700 (PDT) Received: from ?IPV6:2600:8803:e7e4:500:77:c35f:9c1b:c75f? ([2600:8803:e7e4:500:77:c35f:9c1b:c75f]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-41756b38347sm150984fac.5.2026.03.09.09.52.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Mar 2026 09:52:22 -0700 (PDT) Message-ID: Date: Mon, 9 Mar 2026 11:52:21 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] iio: imu: bmi160: Remove potential undefined behavior in bmi160_config_pin() To: Andy Shevchenko , Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Peter Zijlstra , Nathan Chancellor , Jonathan Cameron , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko References: <84155f1de72b88d2841b16db97f47ffa4b0f747e.1773071992.git.jpoimboe@kernel.org> Content-Language: en-US From: David Lechner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 3/9/26 11:40 AM, Andy Shevchenko wrote: > On Mon, Mar 9, 2026 at 6:03 PM Josh Poimboeuf wrote: >> >> If 'pin' is not one of its expected values, the value of >> 'int_out_ctrl_shift' is undefined. With UBSAN enabled, this causes >> Clang to generate undefined behavior, resulting in the following >> warning: >> >> drivers/iio/imu/bmi160/bmi160_core.o: warning: objtool: bmi160_setup_irq() falls through to next function __cfi_bmi160_core_runtime_resume() >> >> Prevent the UB and improve error handling by adding a BUG() if 'pin' has >> an unexpected value. > >> Cc: Jonathan Cameron >> Cc: David Lechner >> CC: Nuno Sá >> Cc: Andy Shevchenko > > Please, reduce the noise in the commit message by moving Cc list to be > below the '---' line. This will have the same effect on email (Git > tools work fine) and if anybody needs this information it will be > preserved in lore.kernel.org archive. In case you have questions about > handling this locally, there is a subthread (patch 18) of this series: > https://lore.kernel.org/lkml/20260123113708.416727-19-bigeasy@linutronix.de/ > And be sure to include the IIO mailing list too, not just the maintainers/ reviewers. Omitting it breaks some workflows.