public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Matti Vaittinen <mazziesaccount@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Shreeya Patel <shreeya.patel@collabora.com>,
	Paul Gazzillo <paul@pgazz.com>,
	Dmitry Osipenko <dmitry.osipenko@collabora.com>,
	Zhigang Shi <Zhigang.Shi@liteon.com>,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org
Subject: Re: [PATCH v3 2/6] iio: light: Add gain-time-scale helpers
Date: Mon, 13 Mar 2023 15:29:24 +0200	[thread overview]
Message-ID: <ZA8lNBPCB4BNnfUq@smile.fi.intel.com> (raw)
In-Reply-To: <31d8bc33-eabe-9084-71c3-7d1e29f51863@gmail.com>

On Mon, Mar 13, 2023 at 03:11:52PM +0200, Matti Vaittinen wrote:
> On 3/13/23 14:40, Andy Shevchenko wrote:
> > On Sun, Mar 12, 2023 at 05:08:48PM +0000, Jonathan Cameron wrote:
> > > On Sun, 12 Mar 2023 17:06:38 +0000
> > > Jonathan Cameron <jic23@kernel.org> wrote:

...

> > > Ah. I forgot the tests that don't have a device so can't use devm.
> > 
> > Why not? I have seen, IIRC, test cases inside the kernel that fakes the device
> > for that.
> 
> I'd appreciated any pointer for such an example if you have one at hand. (I
> can do the digging if you don't though!)
> 
> I am not a fan of unit tests. They add huge amount of inertia to
> development, and in worst case, they stop people from contributing where
> improving a feature requires test code modification(s). And harder the test
> code is to understand, worse the unwanted side-effects. Also, harder the
> test code is to read, more time and effort it requires to analyze a test
> failure... Hence, I am _very_ conservative what comes to adding size of test
> code with anything that is not strictly required.
> 
> After that being said, unit tests are a great tool when carefully used - and
> I assume/hope stubbing a device for devm_ tests does not add much extra...
> But let me see if I can find an example :)

drivers/gpu/drm/tests/drm_managed_test.c ?

(somewhere underneath:

 ret = platform_driver_register(&fake_platform_driver);

which suggests... what exactly? :-)

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-03-13 13:32 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06  9:15 [PATCH v3 0/6] Support ROHM BU27034 ALS sensor Matti Vaittinen
2023-03-06  9:15 ` [PATCH v3 1/6] dt-bindings: iio: light: Support ROHM BU27034 Matti Vaittinen
2023-03-06  9:17 ` [PATCH v3 2/6] iio: light: Add gain-time-scale helpers Matti Vaittinen
2023-03-06 12:52   ` Andy Shevchenko
2023-03-12 16:51     ` Jonathan Cameron
2023-03-13 12:56       ` Matti Vaittinen
2023-03-13 13:14         ` Andy Shevchenko
2023-03-14  6:19           ` Vaittinen, Matti
2023-03-14 11:12             ` Andy Shevchenko
2023-03-18 17:17             ` Jonathan Cameron
2023-03-19 14:28               ` Matti Vaittinen
2023-03-18 17:24         ` Jonathan Cameron
2023-03-13 12:47     ` Matti Vaittinen
2023-03-13 13:25       ` Andy Shevchenko
2023-03-13 13:59         ` Matti Vaittinen
2023-03-13 14:17           ` Andy Shevchenko
2023-03-13 14:25             ` Matti Vaittinen
2023-03-18 17:29           ` Jonathan Cameron
2023-03-12 17:06   ` Jonathan Cameron
2023-03-12 17:08     ` Jonathan Cameron
2023-03-13 12:40       ` Andy Shevchenko
2023-03-13 13:11         ` Matti Vaittinen
2023-03-13 13:29           ` Andy Shevchenko [this message]
2023-03-13 13:59             ` Matti Vaittinen
2023-03-15 10:51               ` Matti Vaittinen
2023-03-15 14:12                 ` Andy Shevchenko
2023-03-15 14:14                   ` Andy Shevchenko
2023-03-17 10:19                 ` Maxime Ripard
2023-03-17 10:57                   ` Vaittinen, Matti
2023-03-13 12:52     ` Matti Vaittinen
2023-03-06  9:17 ` [PATCH v3 3/6] iio: test: test " Matti Vaittinen
2023-03-06  9:19 ` [PATCH v3 4/6] MAINTAINERS: Add IIO " Matti Vaittinen
2023-03-06  9:23 ` [PATCH v3 5/6] iio: light: ROHM BU27034 Ambient Light Sensor Matti Vaittinen
2023-03-12 17:39   ` Jonathan Cameron
2023-03-13 13:34     ` Matti Vaittinen
2023-03-06  9:27 ` [PATCH v3 6/6] MAINTAINERS: Add ROHM BU27034 Matti Vaittinen
2023-03-06 12:25 ` [PATCH v3 0/6] Support ROHM BU27034 ALS sensor Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZA8lNBPCB4BNnfUq@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=Zhigang.Shi@liteon.com \
    --cc=dmitry.osipenko@collabora.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=mazziesaccount@gmail.com \
    --cc=paul@pgazz.com \
    --cc=shreeya.patel@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox