Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp439701rdb; Sat, 30 Sep 2023 10:13:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGaG/n5mCjoWHY0bYM+FiBvfD9iCuIeAGMon11k+tyWGLjlJHGu1RersST2CFqfdfZcdbdi X-Received: by 2002:a17:902:d4ce:b0:1c7:56d8:905d with SMTP id o14-20020a170902d4ce00b001c756d8905dmr1757320plg.60.1696094019740; Sat, 30 Sep 2023 10:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696094019; cv=none; d=google.com; s=arc-20160816; b=Boq7IO+h+fb8WpiazjKYMz9Fr77CI+9vwvcH+rXQHb41oGxLiG3SOhjgiQnggfDIon 37pMxv1c7MIvoD8miy6Xhz3cshqMc+XWjacvZpbGE0+/MuRd7fN0adxAzUuKOFNJeGUh xEYCM2Zi/YYDIx7Z+CA1egSAozYjSyWaFpPDV+CgdMrfbxy25XdlKCTrZFMUjvf2mpq1 5HiZHqiHiBAwkePh9Y0ZqktMf3YXyZ3VRjjRxVKc76v2rSaYq2VZG8fW+KKvig8KsKzX jvQD4TdEGr9qnwS0M1P7q22kqMBZp9JFqUrdMRyRmyKZebRbv7xCGGnL6X9xrfcMzLsO +PgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=TjZBy2ie1IDsQLlIrvmI2W1Po/MrTgyefpablCspuqs=; fh=0d5sezX/0QEMwMe4Rh/O7Y9fI2w/ljJ6FD1mr3Pq0xg=; b=aH8+XZYHO9BG3Jbum57gbjeou5X9T63763XnD4XUJRsN96fjOSk22i040i6KrqyXBE I+yyblMbP8vKXBB7ebEjaqH6QKPbljpws6dj5Fb6bohtLsP7wCtv4zhsSmB2IgVJRUTo yIfC+gpIMEeHfoVA8FEf3tQtNXxDYOswtfI8RFMQVe9MZIi+OaHpeJy6caAy6vwh44M3 pXSFCZPsw9LBbiObH+0ZGhjNw2r8MmlunFjN5tB79edTqJ49V+i6pdAzSuz9ArUQNupn pxicp1l6kQgpoOlU9V3AQEwtrGlUc2MLexhPWrJXX7sygGifOaZ90hTU8seouGGRbzRc VeWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ejnxgRRK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id u8-20020a17090341c800b001b8a3e851d2si24602745ple.342.2023.09.30.10.13.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 10:13:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ejnxgRRK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 37B248025812; Sat, 30 Sep 2023 10:13:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234625AbjI3RNU (ORCPT + 99 others); Sat, 30 Sep 2023 13:13:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234626AbjI3RNT (ORCPT ); Sat, 30 Sep 2023 13:13:19 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0F80E5; Sat, 30 Sep 2023 10:13:17 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C675C433C7; Sat, 30 Sep 2023 17:13:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696093997; bh=AEuIV4qOo/frZ3vn0QZSXE4WVdAdUG2y/1bCK1B7DHg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ejnxgRRKw4ZOITyvC8kMxGy+1hmEEDuRcU0sWqWj3snDeK764WWDvNTfTTT238bf0 wL7FaAxipoujLGpBmQ0ZpBLhSwBMj6kj1hAJbzoP9pKWehQeudKaP9QIzRe+HHl5Co 0y4MAuXP1rPspMMUEJKG3qH2ihQ3XopT0Kw3HhDllxiGZZlT2kyGhRF9Y5egrB3/oE qdCU8b6q6qL2UDMf9e+7HzgSS1tU+IZG0bXLS1nC9i9TdIDQ2n/fj3S2Jx8/PYsC3t u6799cK2PzgJLVFRQzp2h18YRAhgLJp3rsoX+euAcDlqq6jSzv9GajcHWgqwsSw6YK aJQf0/crpvf9A== Date: Sat, 30 Sep 2023 18:13:17 +0100 From: Jonathan Cameron To: alisadariana@gmail.com Cc: Alisa-Dariana Roman , Lars-Peter Clausen , Alexandru Tachici , Michael Hennerich , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/3] iio: adc: ad7192: Use bitfield access macros Message-ID: <20230930181317.2cff5d00@jic23-huawei> In-Reply-To: <20230924215148.102491-2-alisadariana@gmail.com> References: <20230924215148.102491-1-alisadariana@gmail.com> <20230924215148.102491-2-alisadariana@gmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sat, 30 Sep 2023 10:13:37 -0700 (PDT) On Mon, 25 Sep 2023 00:51:46 +0300 alisadariana@gmail.com wrote: > From: Alisa-Dariana Roman > > Include bitfield.h and update driver to use bitfield access macros > GENMASK, FIELD_PREP and FIELD_GET. > > Remove old macros in favor of using FIELD_PREP and masks. > > Change %d to %ld to match the type of FIELD_GET(). > > Signed-off-by: Alisa-Dariana Roman Hi Alisa-Dariana, One more !! in here. I'll get rid of that whilst applying. Applied to the togreg branch of iio.git. Thanks, Jonathan > @@ -682,7 +682,8 @@ static int ad7192_read_raw(struct iio_dev *indio_dev, > long m) > { > struct ad7192_state *st = iio_priv(indio_dev); > - bool unipolar = !!(st->conf & AD7192_CONF_UNIPOLAR); > + bool unipolar = !!FIELD_GET(AD7192_CONF_UNIPOLAR, st->conf); This !! not needed. > + u8 gain = FIELD_GET(AD7192_CONF_GAIN_MASK, st->conf); > > switch (m) { > case IIO_CHAN_INFO_RAW: