Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1562480rdb; Sat, 10 Feb 2024 07:10:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX8fAe3VtsRu9LhFIGH374NUcUVS88JUCEB/21DSm9Rr3Dnrl2Upq0q+VL3X7BAonU3iuXpZAeaUQrLzqsquMuwYoqVwPRmWrhdTlffAQ== X-Google-Smtp-Source: AGHT+IGjafW4xfNIA91sZ+Ib9g2CedjWZLhAK9ubS2tlyPz8D3F3BpaBOZYxHNfEdoja1chiDKOv X-Received: by 2002:aa7:82cf:0:b0:6e0:532a:d5f4 with SMTP id f15-20020aa782cf000000b006e0532ad5f4mr2474184pfn.27.1707577843590; Sat, 10 Feb 2024 07:10:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707577843; cv=pass; d=google.com; s=arc-20160816; b=FWQVqCOCAQ7p9gvUxbLt/pxkwAwYkn0BWi6KLaXDAY2OxOCv2ILT29vByuFsyxEDPf 1/5dDKQYjoaqF3N2jSsQT5moeUTHc5zLMSQTMSRHvAd/wk9fy8wKe8BuD5rvUkJlO0W3 CfCmTIRTpm6ah9eb/LK8DuXUdxWdlcux4zc4d/WYfTDzkWXTm6JA08nWIT+T1+S7V/G2 tc2EddgYSf4qNcQEQjLmFvZjxXGIQShtzjBzISq1KpTq2+gfZjV6T1qM9Ytlyqyo2HRJ xs/eRaolAwJKvlMrovjoGaPp6zOLVbezutL7egm+xeDuk4jAXymAIUAK4d9Kf2KAK58G K6iw== 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=MGQoCtYmjC3TdAlvfP9gyeyl5LZP9B+L5qQlSyfi7qw=; fh=CftesXrCVaXGCx7Iy0u5ZyGR0tl4CiQXAJNNEdRlcFQ=; b=oK0OS8cLg0FtozDEh46iLv+sl6VcWtoi2+ta0Cng5IoM6oHMet1bUewJL8j1jO1Xrh 4eklhrH8Y48SuezT0MuXUJFsrSOo2jE2pidqPg/N0fk1JXsihZDPJ9zqAXObG8Gl9/pC 5VBrJPiAzoirw8lTLjVtGxCPnjq8cOVuxD4pM++A5RAAAewUr1fSJMN78JmNN3i3zMP3 mCDP6G6bc4Jm/Auj3+Yy7j84SToBdt9dxpIwImIMOyPKoL9605VC+gVrXbitg8L9ToMz fTMoFF0dv217//LOdGksQ3g80XJM7pRxSxmlD3SYTRCO5YB9KdB7d5UEPlS9cGPD3buh GzXg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TBxZ6iRT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60429-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60429-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCVqpsBtzhkAgyokVZQUPRrWrxn3LEw9O84HujVJv8QpZHxkaFQrj3UhMkXIXD8dXnhjWTbN4HvzClalDLAWh06veKxJ8i0mNK0+f5OBlQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id a28-20020a637f1c000000b005d988899a3asi3742094pgd.176.2024.02.10.07.10.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 07:10:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60429-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TBxZ6iRT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60429-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60429-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 75A6DB20DC2 for ; Sat, 10 Feb 2024 15:09:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62A795BAD8; Sat, 10 Feb 2024 15:09:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TBxZ6iRT" 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 8332436AF0; Sat, 10 Feb 2024 15:09:20 +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=1707577760; cv=none; b=tbd6uyJnkm420E9p5M8Fs+SX0R7JX8O6P/iu3dOjl7+aM02yL5vned/l5mWin7z96FLRBIILKRWTbqtEugQ53qZTJdmFOrkV3J2NJXuOT/vwDsM45h2IjL20IpsxuqGYUk0bqz0dVZi6+llp+lpFX7PAx2B06Vh9jZUhb+pHcKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707577760; c=relaxed/simple; bh=pLfRpHjTu9m4W1qVp6S/4OIPP2Vk2vK5FIofqlCRYbw=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IlKYsHOw5JWFRMas6qSFQ7ni6/EyeEwNZwEj2o1gDhDkeYXmY0P0OUkcjuM4KGTgTKVXQmUTQdPFEKApDypIos+if2xPVjTpKQw9soQKqPdCp48XcE00wGqIuzYRB+rPh5keR/mf61JOSbGKbRy8cqW42AfyCeJsoru4iIKuFyU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TBxZ6iRT; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02936C433C7; Sat, 10 Feb 2024 15:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707577759; bh=pLfRpHjTu9m4W1qVp6S/4OIPP2Vk2vK5FIofqlCRYbw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TBxZ6iRTVK8O3qULrXjcu9aWbDLvDocrTlaznymZzOSUUDvG9DNb0cS6/ng7KG7KU B8bBeOTMeiTwKXzlQnJZecrw3WLlSIAcmax5EB2O1Y8MqnsvpHHMHxjbcp7TkVYYhK cGi43eDOCg32mB0olSZermbJQBBvv7RANHcgJ7y2NJTOxkjflaYtY8YBTiq0hl8ETP xZ9un7gG+nX6sx4F34kCEijzdGDJ0PsnbTkHLwHnEZV89Q1ay9fIjak06VcHbF+Y5l LubrmNj1nqLHksfS0DUsPiHfext2+lGklbuQ/R6pGgU64ZT9xJhy3v5cbTPE/pGx+h CjmqCKMNhaIFw== Date: Sat, 10 Feb 2024 15:09:07 +0000 From: Jonathan Cameron To: Petre Rodan Cc: andy.shevchenko@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Lars-Peter Clausen Subject: Re: [PATCH v2 4/4] iio: pressure: hsc030pa add triggered buffer Message-ID: <20240210150907.40e27f53@jic23-huawei> In-Reply-To: References: <20240127160405.19696-1-petre.rodan@subdimension.ro> <20240127160405.19696-5-petre.rodan@subdimension.ro> 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 On Mon, 5 Feb 2024 18:39:02 +0200 Petre Rodan wrote: > hello Andy, > > On Sun, Feb 04, 2024 at 06:03:28PM +0200, andy.shevchenko@gmail.com wrote: > [..] > > > + memcpy(&data->scan.chan[1], &data->buffer[2], 2); > > > > Hmm... We don't have fixed-size memcpy() :-( > > __be16 *ptr; > > ptr = (__be16 *) data->buffer; > data->scan.chan[0] = *ptr; > data->scan.chan[1] = *++ptr; > > is this an acceptable replacement? I do not understand that your concern was, my > intent was to copy exactly 2 bytes over. Andy? I'm not sure what you meant here either. There is an existing oddity that the read_raw deals with this as a be32 and masking out the right sections for each channel rather than perhaps more logical be16 pair here. Jonathan > > > > + iio_push_to_buffers_with_timestamp(indio_dev, &data->scan, > > > + iio_get_time_ns(indio_dev)); > > thanks, > peter