Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1277183rdb; Sun, 7 Jan 2024 11:47:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEFCnK4S8XwcdaXtz2rJbExD6xYGWtb2t0h+5mpX1Gb++3vZRFmcC9Y1af6aK/0dijlmlK+ X-Received: by 2002:a17:90a:ee81:b0:28a:c749:23cf with SMTP id i1-20020a17090aee8100b0028ac74923cfmr494513pjz.75.1704656831266; Sun, 07 Jan 2024 11:47:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704656831; cv=none; d=google.com; s=arc-20160816; b=v9eKqmmoM2jqz9oBA9MaIQdxzKvm6acvCTTvSXU4YAsYMZVzffs20mplRu/AaHKhK3 3fkoc3I7KqcFlKP3C9SD4Hk/DJthcZwAicdVFEbaqcqYpyai4y40iPpfju2GnkRuHw9o yMhsOVKOTupAGGWdfVhQz3OVgAYXE9Ut4wB5SdGqlonS36BDjISKVHfVff6zxG44WBcD RPxEl2Nw5+rGNo9h4tAHHJVBE4RuJW+z7Y2TCRULDahaJhvLEf38PFw1ZQmqDTIhvwow i+9425ErkM/IRz8azHkPWW4OlA5/f1infz7C2/pW2qtbkopsYywZdxUkERNM/HJL+3Yh Ff2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Bgw6P5LZhwAlCIvVPfp2eYZqWEaTiqAWQo/dlHlVaXI=; fh=Xx3l+eoQlpU8DMsLuKh99Yndf9XMh3Gm4FnMFUPeYpA=; b=H778Ytuhnf3VOQv5vuiRCFwHYFjVQZ41bc85CJ0ypJwsc3VRd8yA9YKLnqY+6/P6nJ xrjbz9BFFIZ/NtleiOPXXTJzAJ5sC1c/Vq4W0pFCxVZtBetQHDqh2OQ96gr7RBZ/ewJp Tdu/JfCTN15ZG/yN7mOjaV5KhZsJjeoX/Afv0DT0g/tc56AVL9sXl/jakfN/qmz3xXPX agKboAPbSpWb5IpxWjRLVJ2gTuaBh0ARGXN9EntMLJ1od6fzBGr0YwH+AU79i3pcI2VS uERxXGUGHUg96rDpnK4C7Tyu9JmXY0hR3GMrp4UV6TDVfRWQzX6WqBrU3tF/Au2HFfON EL/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BxQVZ7lE; spf=pass (google.com: domain of linux-kernel+bounces-18969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18969-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id mz2-20020a17090b378200b0028d01a3bf10si4475032pjb.11.2024.01.07.11.47.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jan 2024 11:47:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BxQVZ7lE; spf=pass (google.com: domain of linux-kernel+bounces-18969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18969-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DBCAB2819E5 for ; Sun, 7 Jan 2024 19:47:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 773AB111AD; Sun, 7 Jan 2024 19:47:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BxQVZ7lE" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 5F60511193 for ; Sun, 7 Jan 2024 19:47:02 +0000 (UTC) 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 Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-7831f567100so48463085a.0 for ; Sun, 07 Jan 2024 11:47:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704656821; x=1705261621; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Bgw6P5LZhwAlCIvVPfp2eYZqWEaTiqAWQo/dlHlVaXI=; b=BxQVZ7lEndiAHfiLse42mznMDyJC3NIey3+yBfNeqavKNKfSEkf/FI0j21yJParchK L8Rl+zu1YqmeT5PswMvnRm2BDOSNE2HLtK2KnBrDK7lWqDgN9YWBWlLuDhGlKelSLF9b ICGMN9Bu5SO0Y8ja2812JCFQTyf7eUFByBa79HEw/SbbokjJMIU4Qb8eTWxJR23k0F6n 90NkP+3IbGB0/G32nOP70+Aqere5CsWKoLGhmIecS5pzYtFuQD4eDphR1spQ7ERMfQt6 NB59ib7nTuxoLad821AJwGpPMkVRSrhHhKvA1Er9CVguVQVX/zqiLk7Xv9PjvHf6Ldn5 h93A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704656821; x=1705261621; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bgw6P5LZhwAlCIvVPfp2eYZqWEaTiqAWQo/dlHlVaXI=; b=tUyzkbeGKRncubty2RfwthawhLFD6SgY7DQ6p//pUfyUZzHu3/mkQ4YraYLUOJHgbs MGXZNq0Hgc8I9u9KsV77abGpoyzoXO268k5cyea2+GEiqFYssSqxXBPdf2P2JTLkxTCP bOlZ8M/WVQpOx0ld3oycYVNmupv78RtJLwvS51A19x35OZTJ7i7bwGJ94D/yuI657Uok w+tSKwwlzToIQpxJOsMMy2hlHwy1UpXdV+cgbox0KiRZ0no+5N/qz0f2oKClVtk/H82Q ExxNaMXgwDhqauFpCJ9xg172G+ihC5S+vE1laUvmvZrGufeJTTK2e7WdFWM3QokUyH4f v2Lw== X-Gm-Message-State: AOJu0YxebzT1GtPWyF6gFNTK+rz/1FxwBJ9Zbnat9x1SH3Z2Jd3TD2Cr rFs5fiHy7E9k6bnPNsWrTIomhzDDe/1XqgwV79M= X-Received: by 2002:a05:6214:2a8e:b0:67f:3991:ef38 with SMTP id jr14-20020a0562142a8e00b0067f3991ef38mr4009781qvb.122.1704656821115; Sun, 07 Jan 2024 11:47:01 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <202401070901.68H00NFa-lkp@intel.com> In-Reply-To: From: Andy Shevchenko Date: Sun, 7 Jan 2024 21:46:24 +0200 Message-ID: Subject: Re: drivers/iio/adc/axp20x_adc.c:572:26: sparse: sparse: dubious: x & !y To: wens@csie.org Cc: kernel test robot , Aidan MacDonald , oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Jonathan Cameron Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jan 7, 2024 at 7:37=E2=80=AFAM Chen-Yu Tsai wrote: > On Sun, Jan 7, 2024 at 9:30=E2=80=AFAM kernel test robot = wrote: ... > > sparse warnings: (new ones prefixed by >>) > > >> drivers/iio/adc/axp20x_adc.c:572:26: sparse: sparse: dubious: x & !y > > drivers/iio/adc/axp20x_adc.c:577:26: sparse: sparse: dubious: x & !y > > This looks like a false positive. The code is doing exactly what we want: > val =3D val ? 1 : 0, but in a shorter format. Yes, but the problem is that FIELD_PREP() is a macro. You can replace these by ternary (here and in other cases) to satisfy sparse. Compiler will optimize that anyway, so no branch is expected in the generated code. --=20 With Best Regards, Andy Shevchenko