Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp578717lqp; Sat, 13 Apr 2024 09:20:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQ2zbO9sOOTyWJODTjNfLvQuGp0xKmOxF0+2iwRgi1jNTNFU5ugkCwis7QGY7CSa9lEDiiNN6s5m3obuhp45QsII5i6LPHjFHnnABLAg== X-Google-Smtp-Source: AGHT+IGTFifQFMF+JeLN9Qp0IWt2RP9lisTgmew4n+Z5ZY8dTr9AHiQm2yGBatemEpGWE3iUajcO X-Received: by 2002:a05:6512:481a:b0:516:d097:8c32 with SMTP id eo26-20020a056512481a00b00516d0978c32mr3503480lfb.18.1713025225970; Sat, 13 Apr 2024 09:20:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713025225; cv=pass; d=google.com; s=arc-20160816; b=ceqZ6dqxc0bhxLmxKkOzyEcVnuJaUPH/7Yhvy9WClCKSZ40tmVFRskaCkNp9BL8ebI nnV1UY6jIwzXdk3aQb1zsiAeapvJTeUnopLGNQeffgmQLcPPAZ4b6ctO8LD9UB8Ow3SU 3bT7g2a3yJOiO0vYL8xXgERoEmpj9rUE7ObiUU0LIW6NEIsD6t8l5ocSXJOLW+70ltSo oLk17QKu4aYqaQ0BOmNVaP3k134UOi9zrtR4MD6jlrEz1lsULutLVbiKFW7yH2YaRZ4V +rtXs8yInSuUOnXK5UrnnZZtNcV43Xvlks9FC9Z0dCeg8EZbidoK3+rCqjjvA0Z/bdTg uAbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=3yQwKpfc3Kdl/W1rlEMS0zN4cO2rJi7FU9gHS3Osdjs=; fh=me8kXRm7+Lz05CdPwDPXfozsIIcxHWzDZpOnSIzWcMk=; b=R+wG363QIPldZCzi9cmLAFcPQNrGJraCBUBhrXC6ObihDPPofsV7z/kBSwJvfqxhdh C5bIYc0JhdxprjQiPl8LxBWWlzLqkXOqwFEmmifCIskwBmbwyiQcNSXyx1AvoQe38Q2L y1vhxLUxnbN/DeBi6w4gMfR3sCUgU1v6HThlVtke4QY7e6mSIkGzU/qrExrYmWzrf21s 1zW/Dl+/MmIoiG2C53PvEEyXfPIq/+dC45ry8Cqp3fHM63UnNG2qx2jZneHrUyqD/kuj vn11vVWDtLXsNzhbvp8Lj3fdN4e6+YxykIxSdNdoQ2rv+WMz0Km+pxNYbhj8HA9+tXGa tPQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BbSDhnlk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-143806-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143806-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id x19-20020a170906b09300b00a51e4539384si2910412ejy.773.2024.04.13.09.20.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Apr 2024 09:20:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143806-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BbSDhnlk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-143806-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143806-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id AD5701F21944 for ; Sat, 13 Apr 2024 16:20:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB58E4D5A5; Sat, 13 Apr 2024 16:20:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BbSDhnlk" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB3F93D977; Sat, 13 Apr 2024 16:20:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713025216; cv=none; b=SS8p/LOrQn0Euwn0TZbZ00t5zYzI5hUa0XvbgGvhnIynCLVDgLJCK70ZsrPGyRB1CliXBUU6S7HNnMdy3M8uPaggsgnSW1+gl2F3y5fNdbgzEka28XqoCFsWq+cL/uLXhCenYhz87eX57a4JaF9kEciRFYTmKwiuBqjZz5W/A0s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713025216; c=relaxed/simple; bh=u1sdpsHRRMz1U80voi5/l1HBjWo/eglJy0L8udE+sXE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KMsEy7g1nAsCyYNQpp2VblR4d/qf7kShT587ycGfaGOZIgUPORB8EJFjwMVFCDrSWm/G2S5VCb9wR2oa4EXBpKkHZ058YwWLJVVrgKvbLVWpZvX/Q+Qo5hyC0CnG04AUCbUlcZuE2Aefk/nu6h0UFSvkcaLTY6wmAAdAdGHWJeI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BbSDhnlk; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1788AC113CD; Sat, 13 Apr 2024 16:20:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713025215; bh=u1sdpsHRRMz1U80voi5/l1HBjWo/eglJy0L8udE+sXE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BbSDhnlk4kaKT6z5SiGBibVAWc7CXKIyLy30sSTy63P85AOHCy7M69KedHfJZEKON L/1afOfZc8oW5JO32sUF9amzSxhyoEtSV1eu0u5wLzKTItp/8i8Qj9d5CMiODRTfA0 cwGzJF8QNuYXtpiT4PBrbSZY4FY4UcvFWRUWIvMi25Lboms9b1FWAvpcS7aQJaiijy 9JujxORcsa7phI3IRMFzF1lp0sXkgNg8pa3do1QvMWHXzaM0bg1Vp0B25CiaJtiHFg FP34REKX4W1G1FmF4vQ70b8ip/OVRB2LKk5lLUtylkpRno7XHkLvJ7vKO6DT4We9w3 /uFQHZR0vBvyQ== Date: Sat, 13 Apr 2024 17:19:59 +0100 From: Jonathan Cameron To: David Lechner Cc: Marcelo Schmitt , lars@metafoo.de, Michael.Hennerich@analog.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, marcelo.schmitt1@gmail.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] iio: adc: Add support for AD4000 Message-ID: <20240413171959.2361c80d@jic23-huawei> In-Reply-To: References: <1d95d7d023dad69b894a2d0e7b0bad9d569ae382.1712585500.git.marcelo.schmitt@analog.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > > > + > > + ret = ad4000_read_sample(st, chan); > > + if (ret) > > + return ret; > > + > > + if (st->cnv_gpio) > > + gpiod_set_value_cansleep(st->cnv_gpio, GPIOD_OUT_LOW); > > + > > + if (chan->scan_type.storagebits > 16) > > + sample = get_unaligned_be32(&st->scan.data); > > + else > > + sample = get_unaligned_be16(&st->scan.data); > > data is aligned, so be32/16_to_cpu() should be fine. Also, Jonathan > will suggest to use &st->scan.data.sample_b32/16 here too. :-) Sparse may well complain as well and no one likes build warnings ;)