Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5636773rwr; Mon, 1 May 2023 08:37:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6YXwE8HV3PP6prizQvCSa44+yDZ0grF/PUAE7+LcHHNr46CdyB3SYVThnXvLRtWNBqPCQI X-Received: by 2002:a05:6a20:94c6:b0:ef:7b11:3ae with SMTP id ht6-20020a056a2094c600b000ef7b1103aemr14994871pzb.52.1682955455300; Mon, 01 May 2023 08:37:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682955455; cv=none; d=google.com; s=arc-20160816; b=Ce5jJSdCL43KlJ/hluD2QG9EpCKa8GnNbYXe6SnflgU4xtBJv3Dt75l99zBqlIMSas uNrEJF+o8Y59wK204dYOw0CJPWv9wuDYwBIruoFBo4CydYjk49ypNq/64vnN0EHm44pT y8rHuSzygrgfteexNKncXHrVO0TJZnVV9UXsM/I2XbFgf3ItvtVUd11hbTczI9dahWOy J1KFyb+P6Uu1AJEn3L6qXy/TJH2rOZoDAqX5rzNJQCtJ9zPnIKz3UJA+cDvI9+mtmmgt ngJgKo5RmmKSRaYR+ea8NE5r6PNlAJO43D29JeAMWVxYVpfTEG0hdEAAFxOd2RzPJndF kEOw== 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=pUF/UUDLcEhQTtl/6DSSHA7K3zI5HKsHx2W7aAVq/qo=; b=FKmSPSSJzK+yBObvA2ErCXZuhxt/egtNqCm/FDLRE6IwccgNvfZytSj19+B7EwK/tt 8sYrFvWE1BcDiJ7H2Y9JBYVki3C+rZNu665avhwot9r+vaeOmlwKrmrCZlTJ2i9ZlWef LtBWZOLxy5gB4x4fVufTSCn2mTQnpRlO8T6L9JGhPTeRLPvh5Xe9Xf6utEZhzITLCvzR jcvvLvIIv1jkxtOsedWd4YutvuNW2rgmaEkf154ftA9GaQatrcTzBH4FnzSN9R/vtDLg dDfmL4TmUDwfBrAmiUFW/RQNXsfzHGa+nRsa0EE12wMv5JXNVPA38hd9gqKPa8TPKaf3 u+sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qkGJVcaq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y65-20020a638a44000000b00528c6c2ea96si7190666pgd.306.2023.05.01.08.37.21; Mon, 01 May 2023 08:37:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qkGJVcaq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232513AbjEAPdA (ORCPT + 99 others); Mon, 1 May 2023 11:33:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229928AbjEAPc7 (ORCPT ); Mon, 1 May 2023 11:32:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49CEB118; Mon, 1 May 2023 08:32:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D91A7616DE; Mon, 1 May 2023 15:32:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FCFAC433D2; Mon, 1 May 2023 15:32:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682955177; bh=MvuETEoacr5bq53WzR8YZikS4Thl13VEKTBpvEqCcNA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qkGJVcaqQ5lDiIjCfO2G2dtZDC6KU3mjtZvL4nkBGjtykU9bmkCuwAV1IAgSarPh3 9FmJTN5WUOpZMlPRbov1x3R9KxdfrRodTnH3CSSeffDJ9NeqovA9GOJ9rVW1i7Er3Q t4DttR0CNMztvKMCL34aNvLRQNXX+FFoX6/oyAHdqT2DF3kTs3bZLDZsom3CbKFKe6 H/jNKpebNOjoHFBeHS3EOqqS+25v5NbEM7jSJvBDIw5c1KY+0FFcwAQIoQNw6JgRbF ljuqlfAkr24mPeTUNSC89Be9z389Bm9biyEE6AEUvdohuKsuNOM+p2qlmUEYPcYZJt aYiyU9xtQnm2A== Date: Mon, 1 May 2023 16:48:43 +0100 From: Jonathan Cameron To: "Vaittinen, Matti" Cc: Matti Vaittinen , Lars-Peter Clausen , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 2/2] iio: gts-helpers: fix integration time units Message-ID: <20230501164843.18d9ec6f@jic23-huawei> In-Reply-To: References: <20230423121815.6d7c8039@jic23-huawei> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; 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=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 24 Apr 2023 05:09:36 +0000 "Vaittinen, Matti" wrote: > On 4/23/23 14:18, Jonathan Cameron wrote: > > On Mon, 17 Apr 2023 12:20:18 +0300 > > Matti Vaittinen wrote: > > > >> The IIO ABI mandates expressing integration times in seconds. The GTS > >> helper errorneously uses micro seconds in integration_times_available. > >> Fix this by converting the lists to IIO_VAL_INT_PLUS_MICRO. > >> > >> Signed-off-by: Matti Vaittinen > >> --- > >> drivers/iio/industrialio-gts-helper.c | 43 ++++++++++++++++++++------- > >> 1 file changed, 33 insertions(+), 10 deletions(-) > >> > >> diff --git a/drivers/iio/industrialio-gts-helper.c b/drivers/iio/industrialio-gts-helper.c > >> index 8bb68975b259..2ab8d2dce019 100644 > >> --- a/drivers/iio/industrialio-gts-helper.c > >> +++ b/drivers/iio/industrialio-gts-helper.c > >> @@ -337,6 +337,17 @@ static int iio_gts_build_avail_scale_table(struct iio_gts *gts) > >> return ret; > >> } > >> > >> +static void iio_gts_us_to_int_micro(int *time_us, int *int_micro_times, > >> + int num_times) > >> +{ > >> + int i; > >> + > >> + for (i = 0; i < num_times; i++) { > >> + int_micro_times[i * 2] = time_us[i] / 1000000; > >> + int_micro_times[i * 2 + 1] = time_us[i] % 1000000; > >> + } > >> +} > >> + > >> /** > >> * iio_gts_build_avail_time_table - build table of available integration times > >> * @gts: Gain time scale descriptor > >> @@ -351,7 +362,7 @@ static int iio_gts_build_avail_scale_table(struct iio_gts *gts) > >> */ > >> static int iio_gts_build_avail_time_table(struct iio_gts *gts) > >> { > >> - int *times, i, j, idx = 0; > >> + int *times, i, j, idx = 0, *int_micro_times; > >> > >> if (!gts->num_itime) > >> return 0; > >> @@ -360,6 +371,7 @@ static int iio_gts_build_avail_time_table(struct iio_gts *gts) > >> if (!times) > >> return -ENOMEM; > >> > >> + > > > > Grumble. > > Oh. I wonder how things like this tend to slip-in. Maybe I should change > my password, it must be someone else has cracked my it and is typing > these in at night while I am sleeping ^_^; > > > If nothing else comes up I'll tidy that stray line up when applying. > > Thanks! > > > Note that these will need to wait for after rc1 now so my fixes branch > > has moved on to include the code being fixed. > > Well, that's Ok. Please, let me know if you want me to rebase to rc1 and > respin the series. No need as not much changed around these (not I'm not at rc1 yet, but char-misc-linus now includes these so I rebased on that) Applied to the fixes-togreg branch of iio.git with fixes tags added now the commits are upstream. Thanks, Jonathan > > --Matti >