Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4166547iog; Tue, 28 Jun 2022 10:17:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sAh5Z4oZIXqGNmLtwkV4kFhEe3TJxStu0qbcuSST+yFtgWkItV//xKAc4Hil9tc34moFLx X-Received: by 2002:a05:6402:5207:b0:435:a27b:88f7 with SMTP id s7-20020a056402520700b00435a27b88f7mr25009560edd.22.1656436668749; Tue, 28 Jun 2022 10:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656436668; cv=none; d=google.com; s=arc-20160816; b=TWARQ6awWTC/i2A0/zvZfJIR8HV2Ukq6YnGNTsx2HRkecZDT8IvJJo9PsO7B2MZ3du BUbp8KeYLIlLUvf+My70LRpj4WvIGIbc2AXJ5hCw3KkzZyK7CZGpKZ5CcHBwHZD9ErWy PsFLvpv78mR6BkmQ4xgdJ3tVtNJN8IQZT9US7FymRfrWCJGKUiaorBX+wLKp2mLvBX92 1T++esux+dOzjLxK+CFYg/8eoZHFJgxO4RQ31qIMWy62P9ec3+7thcIeKFYjtCF4fIVy k6mS8oqWW7nuqSEsNP4gut9FK8Zx7QS8/Jwj9CilNxUePbXjpWdi/dVqdLdVL4t/2yZK D9Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8bQ8ei1JkcwOHR5YxHEw7aHiNSi0KYBwHi+TZqv03IU=; b=YoMzKV1/P4cFm3tBIdQBY7w9DqRLIS43onacMuXuwfQ1sOjYvdA0SNByg4E1iYeo9t FweborEZfz5qmLV4YA7CmI5FeqULaa3Q7B93iOFk9CZg+hj40U9pOJ6VsqmKBf+njSF9 NOv2g/W7hfh1Bata//w36Y0xqJxZ8RDIC7jYbTmzT3zTh8o/xOUfCKfLT1dx7PIbCuZr 4ILm9Pfeb3ZrUYtVjPI0XppSINp0ADRQG315Leru1qP6/fnQVWK1k2GV8O0dx33s5Ffg 3RvgVwT0R7qVDFaFBqMANmWQZk2LutNoWztHeYj0Hcu41jkh3Z4lPbaf68qpfcMMxyqg 60IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=i5dDrqOM; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f20-20020a056402355400b004379267f19csi230227edd.453.2022.06.28.10.17.23; Tue, 28 Jun 2022 10:17:48 -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=@gmail.com header.s=20210112 header.b=i5dDrqOM; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232349AbiF1RGg (ORCPT + 99 others); Tue, 28 Jun 2022 13:06:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229896AbiF1RGe (ORCPT ); Tue, 28 Jun 2022 13:06:34 -0400 Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1814E2B1BE; Tue, 28 Jun 2022 10:06:33 -0700 (PDT) Received: by mail-qv1-xf35.google.com with SMTP id c1so20915600qvi.11; Tue, 28 Jun 2022 10:06:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=8bQ8ei1JkcwOHR5YxHEw7aHiNSi0KYBwHi+TZqv03IU=; b=i5dDrqOMKlZHRI0VmPlke/MZaZP5psV64tvfJ/TY/NYY10OAtco34+1btuy0I9jCiT CYq/P/u4f8kZpFNXLFZ4dIHvQ8j7I4rdh69AcN7/jjE6sE6ZJI3m+q3FCX9bKxAQIu+Z t2JRrw31ixhFlXaG13J7nLd8WwqLY4i1FhWobytrjeoMRtrVpSA1bXLbb9hPfQA629fF dH2EfTdZTd52GWkXMwjhFJoPIWSKUIMZ8sh1bRqGHNYd4MmiW0LsxxqPBbyPheTaxj24 gSFi9jNL76HmCR2+K+UhSYYtPq5oKB3OFzy/rSNEiIv6VOnA5pUYBaEhjkRCMaG9ZZYC yDrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=8bQ8ei1JkcwOHR5YxHEw7aHiNSi0KYBwHi+TZqv03IU=; b=y4CkdD1KV5OD7EFIxiyWw02wXswS82pbKP0UZN4rMsJBiCiAoQGGUH8zbeUH8/Bv5p dCpXi/mH9sQ+IUEG3EA4LZcl0OyDaxKVhvirU54f67kwTwH4rFsWHIv9MQvJjkIpgpZh 6H6D2caW4b0o6XRLfbPRaE4F48EtvtEfcMMEl/w97eG26R5ZTKLcw0kzTxGIaOzcwrwe 2AL0reYSjUy03hRdAo2+Tsaa6APZQnloagNuxZU4oYoRrt5DeMbs2Pfi9x8yEFujkFrr 8MbyDh3l25g9BFOR0sUNxOq7yHYcH3OXP12msiHUDa4qxKt5TKUHdQXdcJ24Ki/nQzZH XTiA== X-Gm-Message-State: AJIora8HgnQxgLs+O1mJgXAyNdgkABN7XR3LX5s6DfWc3t0Q3BE/Homy TZWH+ep0rosutQNZLHFGKTsHEfiNvHI= X-Received: by 2002:ac8:5f4e:0:b0:31b:f5e3:6e97 with SMTP id y14-20020ac85f4e000000b0031bf5e36e97mr2093706qta.623.1656435992102; Tue, 28 Jun 2022 10:06:32 -0700 (PDT) Received: from shaak (modemcable055.92-163-184.mc.videotron.ca. [184.163.92.55]) by smtp.gmail.com with ESMTPSA id br14-20020a05620a460e00b006a6ce613c7csm6250443qkb.89.2022.06.28.10.06.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 10:06:30 -0700 (PDT) Date: Tue, 28 Jun 2022 13:06:26 -0400 From: Liam Beguin To: Geert Uytterhoeven Cc: Peter Rosin , Jonathan Cameron , Andy Shevchenko , Lars-Peter Clausen , Linux Kernel Mailing List , linux-iio@vger.kernel.org, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Rob Herring Subject: Re: [PATCH v15 06/10] iio: test: add basic tests for the iio-rescale driver Message-ID: References: <20220213025739.2561834-1-liambeguin@gmail.com> <20220213025739.2561834-7-liambeguin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Hi Geert, On Mon, Jun 27, 2022 at 09:22:29AM +0200, Geert Uytterhoeven wrote: > Hi Liam, > > On Mon, Feb 14, 2022 at 12:00 AM Liam Beguin wrote: > > The iio-rescale driver supports various combinations of scale types and > > offsets. These can often result in large integer multiplications. Make > > sure these calculations are done right by adding a set of kunit test > > cases that build on top of iio-test-format. > > > > To run these tests, add the following to .kunitconfig > > $ cat .kunitconfig > > CONFIG_IIO=y > > CONFIG_IIO_RESCALE_KUNIT_TEST=y > > CONFIG_KUNIT=y > > > > Then run: > > $ ./tools/testing/kunit/kunit.py run --kunitconfig .kunitconfig > > > > Signed-off-by: Liam Beguin > > Reviewed-by: Peter Rosin > > Thanks for your patch, which is now commit 8e74a48d17d509bf > ("iio: test: add basic tests for the iio-rescale driver") in v5.18. Thanks! I also recently sent a fix for this which recently made it upstream: 7a2f6f61e8ee ("iio: test: fix missing MODULE_LICENSE for IIO_RESCALE=m") > > --- a/drivers/iio/test/Kconfig > > +++ b/drivers/iio/test/Kconfig > > @@ -4,6 +4,16 @@ > > # > > > > # Keep in alphabetical order > > +config IIO_RESCALE_KUNIT_TEST > > + bool "Test IIO rescale conversion functions" > > Is there any reason this cannot be tristate, so I can always enable > this as a module, and run the test by loading the module whenever > I want? I based this patch off of IIO_TEST_FORMAT, and also thought that Kunit tests had to be built-in to work with tools/testing/kunit/kunit.py Looking at the Documentation again, it seems I was (partially?) wrong, kunit tests can be run as module, but manually. I could give this a try and send a patch in the next few days. Cheers, Liam > > + depends on KUNIT && !IIO_RESCALE > > + default KUNIT_ALL_TESTS > > + help > > + If you want to run tests on the iio-rescale code say Y here. > > + > > + This takes advantage of ARCH=um to run tests and should be used by > > + developers to tests their changes to the rescaling logic. > > + > > config IIO_TEST_FORMAT > > bool "Test IIO formatting functions" > > depends on KUNIT=y > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds