From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 EAD8E27AC4D for ; Mon, 17 Nov 2025 19:23:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763407428; cv=none; b=nUbAYr/w7KdfcYyyaWrBF25Llo7Zc7QxaTlBEw3A0nA647k/m+QxhxaKMDkHWUglDrt9HVmXWzKuX/YHTeE5pm/Igy96M+NwFru6QglBSni2LSE4QvwCuniuXlPFaBP2fI3pnf1BJZbuzmCGHhw6ZG7H9EOBBW00Z5SxgqIXl2A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763407428; c=relaxed/simple; bh=sTgr/cCR5rQ198gvvRk9lbJy5qEfmwTEVsfJmE9BKcY=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=WAEC2GMBVgo9tOsCucgn0/y+5inYYKGWSJZUkNmV8Ek3g9V0LBjMpNK70KaOdOeupxBeQHbzqeOWS5Z2RHtobnaBBR309/AZxqKucYGcvxKRAqgxj76f5W8IY13IUbnE6JdTwDkeBefyjHZK0rM8Ps/+uI6r6U+jTqZBdeVXxvE= 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=EZ2yzndN; arc=none smtp.client-ip=209.85.218.43 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="EZ2yzndN" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-b71397df721so669460166b.1 for ; Mon, 17 Nov 2025 11:23:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1763407423; x=1764012223; darn=vger.kernel.org; h=mime-version:user-agent:organization:references:in-reply-to:date:cc :to:from:subject:message-id:from:to:cc:subject:date:message-id :reply-to; bh=sTgr/cCR5rQ198gvvRk9lbJy5qEfmwTEVsfJmE9BKcY=; b=EZ2yzndNWSBabbKhQcABup443id8g4V0OVTGM5+1YfAYV5KC8spm5weTlK4xsdm74y JD6NCfqCFKpvV2Hgb7M9kynHfv4GYqYSYGClvKz69PBRoRm+71KUGfEbiuDrcHYrIV0S MBVvicDXxcaaSHwNcFrFnbZwpS5AyLQQ6j7jsr3LFcVROIke4Ejxlapn4RgPFh/ng00/ YbWLOkOr0qZ4t+/zw8AmZrQOt8otkg589at+Rq8FVmrpOeIlFfTBHR7sTR/Qjk0iCHB5 6yUjdjE/ZS3SHZqNZ7zR/xKOofrGfnJAluJ2QMOYTZKSAOsqOVsLH6SakiXC1x+Ujvuh EADQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763407423; x=1764012223; h=mime-version:user-agent:organization:references:in-reply-to:date:cc :to:from:subject:message-id:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sTgr/cCR5rQ198gvvRk9lbJy5qEfmwTEVsfJmE9BKcY=; b=pi14mLwfd7Iod9ugihQfIWyefB/8Ezq9B3iEi5tBtVTj/y4665S9slNVZqRJ8yTVR7 QjmQYCmwF/61q9bfQ9pNQ5yfxYWHOcU3YkJuurVQ5YG+GHSdNAx7AQuZ7rS1prd1kNf3 XtXnagY0l4kn7U3koJx82yse5OeAJfSBxOxqA7qr40Z4UpQSFB/ZAOlEW1dYYHNyfStx ujOYsKOsYLWAHGRsoJz80uQ8qS4hiPbOBT70jmYck2GYjyVBkyDESVz1m63/u7BG8lP+ XDzIBUp4MVceyyQODqyjFEmxDLtuZ8WTyat8TGuU8tcqjiWIgylV9H1QEboyZea4VVum e9OQ== X-Forwarded-Encrypted: i=1; AJvYcCVNgU/zAd62W4Dy476VizjgOplrF/MY83C3RSomGbe357Zm7c376CDzqbmrZDrcHhJ3rAs3EFieIlHKi7k=@vger.kernel.org X-Gm-Message-State: AOJu0YwYRySx8wD6jzS2DE0BeWz2E8jXilVI3xytboSZPOTGIKaEA3mS /+YY68z51kzD1BnzVpbYOla0h85qfLj+3DduUGHAOtyHMJV1cWjmP3CuuYLWCo/9/Bk= X-Gm-Gg: ASbGnct6z/wlWFq/ISOi3OG2uDZRpt9AMt2gwcejxsQrZ9eezpijbKI5rCK66wngCAJ CYCbyKxlOR/5xCkVhEpbS9VykHVa/JJJV/RcVum6NgdzxzzrjR5GWdE6+k0M0CUqvYCttXJQi0z eaRJlXyM/WW/fqDhNM9szMBzaiZmv0Qu+QzztHp1GmDKjyyBSClYWwMHMsUjriYLWYInwpYUqkm ZIBntSWptwp0UTitp+lo23A4ktCbMn9n06Ls1cWXlua/oZnfXEEebDZPkY6qpXEXr5FXy0S+Lcr QwiJiPb/hkobaXFZGbjJ0pY3Y5Wc2up0nX2uNVSEXem0D096o7mlCZN4bnS7DUS1cI9R1DAX79J xnbKRgrrJrZVhqOC+JHQs1EcqgO0aT/UuUTVtqJTyiE7WIs3JWLdtcwMKq8i7UHEY12mVDMwIlt i7A2fSyrmYr8MQbFZFu/RbQmf3ZXwM1PDiw01Xd61vXlJz5NnQzpnfXi8Chrax X-Google-Smtp-Source: AGHT+IG+yiygqQm9CiObIS61IUqNuGkJpW3m2zFGp1F2YDfUOa+COxpnpwQncvBwCC8zgRehSyQj6w== X-Received: by 2002:a17:907:1b14:b0:b73:8d2e:2d30 with SMTP id a640c23a62f3a-b738d2e3694mr664368966b.39.1763407423214; Mon, 17 Nov 2025 11:23:43 -0800 (PST) Received: from [10.203.83.1] (mob-176-247-43-136.net.vodafone.it. [176.247.43.136]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b734fda8da2sm1120970666b.55.2025.11.17.11.23.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Nov 2025 11:23:42 -0800 (PST) Message-ID: <5b23d077d8882d6b2a2e66817b1b6bcebc6bb5a2.camel@baylibre.com> Subject: Re: [PATCH 8/9] iio: imu: st_lsm6dsx: add event configurability on a per axis basis From: Francesco Lavra To: Andy Shevchenko Cc: Lorenzo Bianconi , Jonathan Cameron , David Lechner , Nuno =?ISO-8859-1?Q?S=E1?= , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 17 Nov 2025 20:23:35 +0100 In-Reply-To: References: <20251030072752.349633-1-flavra@baylibre.com> <20251030072752.349633-9-flavra@baylibre.com> Organization: BayLibre Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-LMDfikblbUQzONUIIIpj" User-Agent: Evolution 3.46.4-2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --=-LMDfikblbUQzONUIIIpj Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2025-10-30 at 15:56 +0200, Andy Shevchenko wrote: > On Thu, Oct 30, 2025 at 12:23:19PM +0100, Francesco Lavra wrote: > > On Thu, 2025-10-30 at 10:24 +0200, Andy Shevchenko wrote: > > > On Thu, Oct 30, 2025 at 08:27:51AM +0100, Francesco Lavra wrote: >=20 > ... >=20 > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0old_enable =3D hw->enabl= e_event[event]; > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0new_enable =3D state ? (= old_enable | BIT(axis)) : (old_enable > > > > & > > > > ~BIT(axis)); > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (!!old_enable =3D=3D = !!new_enable) > > >=20 > > > This is an interesting check. So, old_enable and new_enable are _not_ > > > booleans, right? > > > So, this means the check test if _any_ of the bit was set and kept > > > set or > > > none were set > > > and non is going to be set. Correct? I think a short comment would be > > > good to have. > >=20 > > old_enable and new_enable are bit masks, but we are only interested in > > whether any bit is set, to catch the cases where the bit mask goes from > > zero to non-zero and vice versa. Will add a comment. >=20 > If it's a true bitmask (assuming unsigned long type) then all this can be > done > via bitmap API calls. Otherwise you can also compare a Hamming weights of > them > (probably that gives even the same size of the object file, but !! > instructions > =C2=A0will be changed to hweight() calls (still a single assembly instr o= n > modern > =C2=A0architectures). These are u8 variables, so we can't use the bitmap API. And I don't understand the reason for using hweight(), given that the !! operators would still be needed. --=-LMDfikblbUQzONUIIIpj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEhleFT5U73KMewxTm7fE7c86UNl8FAmkbdjcACgkQ7fE7c86U Nl89Pgv+IELjf0J8E61Wde2AB7Nhrv3vDN2XuVUPNmjXu4mKEtJ0TZwI7dIblLMP 4aR06Mu7FinPtgV3Ks8WcETmJl8CU4XRc2/TesrTFQqoKjxrw6AwR5QS5d0imrwh L43b05j7Z6UadnXP4AqIHns0PBWLNQiFFr4BEDcOv/hBpS58DlUbntoSZYJ3nqdr KzX8GJ1EiqQuShUZeqVWF/Y1FMrS+CGg+XiU0Dv5gD0Xe2XNGAF6QOZGfUufbFXJ vQWtohGsow7Prdxc5LUhE8/KpVcnfQjOnfAaDLRRDm6lInYljm1iGpybd9xJfLIK FOPE/LwhGGwzEYqr95wBtvJF8mOVxnWoi8R0rL6b+xV4p6sLm9jVvnIciZT9ec81 elsm680NP2WyoIBJ0Bw0UFx4hVHP9O1v4cBF6UuHHrWP2nZ7IQrr/R9lM0vTA/6z Mw77zajP867LjbNds95WnHo+G4rJltfJ+anohXFUi88uQlKooBSxlwCbp4lbhnIq 3YrXp7Qx =g5jt -----END PGP SIGNATURE----- --=-LMDfikblbUQzONUIIIpj--