Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1948315rdb; Sun, 4 Feb 2024 08:04:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHNVn6P8U71VHtzpwJYe2Dy74a71+8v8A5oAem8fszg61OgwJeHSUNWbYSdEAv9jM2aTT7W X-Received: by 2002:a17:90a:4a85:b0:296:44f1:e19e with SMTP id f5-20020a17090a4a8500b0029644f1e19emr5616864pjh.22.1707062687293; Sun, 04 Feb 2024 08:04:47 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWCaT2lBxw9yWrRrY9nIcQk0HU1+c4WWdUGx6vOTpGLrjjzgroM9+QDP0MG4qZhOH2xOAyo0ftFO3plpGxvuN12d6oFRuSyxYsoLDW7cQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 12-20020a170902ee4c00b001d5cfb42818si4464603plo.642.2024.02.04.08.04.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 08:04:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51770-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; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-51770-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51770-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (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 EE4CE28327D for ; Sun, 4 Feb 2024 16:04:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7193E22EE0; Sun, 4 Feb 2024 16:04:41 +0000 (UTC) Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) (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 4D5012261B for ; Sun, 4 Feb 2024 16:04:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707062681; cv=none; b=jqutEFUuncSDX7XpywZef0Xda935Lglg9mFnev43ljgwj9kHKTj4s+u5c6S0WFx1pyuf4sestafPScRoyzmGF8LziC+66yFC0GxEWdXvjIYpXfqp1WWuEf4o7dorMCEDNqwWsMw5OANsnmRIhCY3ZlWo9bhTFCMWUjiFI7TQez8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707062681; c=relaxed/simple; bh=84hkzMnb4d0qSNlDJzg77SjZalzYwkJt2ttpNlkHAS0=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uj0QcMc3vtI35nOFXLYuMhTp6hFRgiZSmEy3Y87YFqMykJt0iTcpcuWEl0sAFPxaow4F2oEH3AZLOGI3oC9va3ruq6p+AgCuccc6Ybf/h4W8uB2QYVa8jroAR5spw68oRpNONGEkNnWl5YBYcPNlTx2riBSMwtrD2gNeRxGIhjg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-30.elisa-laajakaista.fi [88.113.26.30]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id ef68d8fc-c376-11ee-b3cf-005056bd6ce9; Sun, 04 Feb 2024 18:03:28 +0200 (EET) From: andy.shevchenko@gmail.com Date: Sun, 4 Feb 2024 18:03:28 +0200 To: Petre Rodan Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Cameron , Lars-Peter Clausen Subject: Re: [PATCH v2 4/4] iio: pressure: hsc030pa add triggered buffer Message-ID: References: <20240127160405.19696-1-petre.rodan@subdimension.ro> <20240127160405.19696-5-petre.rodan@subdimension.ro> 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-Disposition: inline In-Reply-To: <20240127160405.19696-5-petre.rodan@subdimension.ro> Sat, Jan 27, 2024 at 06:03:58PM +0200, Petre Rodan kirjoitti: > Add triggered buffer feature. .. > +static irqreturn_t hsc_trigger_handler(int irq, void *private) > +{ > + struct iio_poll_func *pf = private; > + struct iio_dev *indio_dev = pf->indio_dev; > + struct hsc_data *data = iio_priv(indio_dev); > + int ret; > + > + ret = hsc_get_measurement(data); > + if (ret) > + goto error; > + memcpy(&data->scan.chan[0], &data->buffer, 2); You probably wanted here &data->buffer[0] as currently you use pointer to the poiner. > + memcpy(&data->scan.chan[1], &data->buffer[2], 2); Hmm... We don't have fixed-size memcpy() :-( > + iio_push_to_buffers_with_timestamp(indio_dev, &data->scan, > + iio_get_time_ns(indio_dev)); > + > +error: > + iio_trigger_notify_done(indio_dev->trig); > + > + return IRQ_HANDLED; > +} -- With Best Regards, Andy Shevchenko