Re: [PATCH v3 1/4] kernel/resource: Provide mem region release for SOFT RESERVES

2025-04-04 Thread Andy Shevchenko
us enough. Maybe it's worth the long > name to spell it out some more.. e.g. something like And perhaps drop 'extern' as it's not needed. > extern void release_softresv_mem_region_adjustable() ? > > #ifdef CONFIG_MEMORY_HOTPLUG > > extern void merge_system_ram_resource(struct resource *res); > > #endif -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 1/4] kernel/resource: Provide mem region release for SOFT RESERVES

2025-04-03 Thread Andy Shevchenko
comments as per above function. > +} > +EXPORT_SYMBOL(release_srmem_region_adjustable); > +#endif -- With Best Regards, Andy Shevchenko

Re: [PATCH v9 5/6] scanf: tidy header `#include`s

2025-03-07 Thread Andy Shevchenko
On Fri, Mar 07, 2025 at 07:34:29PM +0200, Andy Shevchenko wrote: > On Fri, Mar 07, 2025 at 06:27:38AM -0500, Tamir Duberstein wrote: ... > > #include > > + array_size.h > > > #include > + bug.h // BUILD_BUG_ON() Actually if it's only BUILD_BUG_ON()

Re: [PATCH v9 5/6] scanf: tidy header `#include`s

2025-03-07 Thread Andy Shevchenko
based on the context of your changes, I haven't checked the resulting file in full, please do it yourself. -- With Best Regards, Andy Shevchenko

Re: [PATCH v8 4/4] scanf: break kunit into test cases

2025-03-05 Thread Andy Shevchenko
On Wed, Mar 05, 2025 at 10:57:47AM -0500, Tamir Duberstein wrote: > On Wed, Mar 5, 2025 at 10:55 AM Andy Shevchenko > wrote: > > On Wed, Mar 05, 2025 at 10:25:51AM -0500, Tamir Duberstein wrote: > > > On Wed, Mar 5, 2025 at 10:01 AM Petr Mladek wrote: > > > >

Re: [PATCH v8 4/4] scanf: break kunit into test cases

2025-03-05 Thread Andy Shevchenko
AFAIK, there > > are people working in this optimization and they might need > > to revert this change. > > Yeah, I don't feel strongly. I'll just restore all the includes. It will be blind approach. Please, try to look at them closely and include what you use (IWYU principle). I don't think anybody uses kernel.h here, for example. -- With Best Regards, Andy Shevchenko

Re: [PATCH v8 4/4] scanf: break kunit into test cases

2025-03-05 Thread Andy Shevchenko
the header files which helps to speedup build. AFAIK, there > are people working in this optimization and they might need > to revert this change. +1. -- With Best Regards, Andy Shevchenko

[PATCH net-next v4 0/4] ieee802154: ca8210: Sparse fix and GPIOd conversion

2025-03-05 Thread Andy Shevchenko
) - unfolded PTR_ERR_OR_ZERO() to the preferred pattern (Miquel) - collected tags (Miquel) Andy Shevchenko (4): ieee802154: ca8210: Use proper setters and getters for bitwise types ieee802154: ca8210: Get platform data via dev_get_platdata() ieee802154: ca8210: Switch to using gpiod API dt-bindings

[PATCH net-next v4 3/4] ieee802154: ca8210: Switch to using gpiod API

2025-03-05 Thread Andy Shevchenko
: Andy Shevchenko --- drivers/gpio/gpiolib-of.c | 9 ++ drivers/net/ieee802154/ca8210.c | 57 +++-- 2 files changed, 28 insertions(+), 38 deletions(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index a7370fa48556..280d56736844 100644

[PATCH net-next v4 4/4] dt-bindings: ieee802154: ca8210: Update polarity of the reset pin

2025-03-05 Thread Andy Shevchenko
The code has been updated to follow what datasheet says about the polarity of the reset pin, which is active-low. Update the device tree bindings accordingly. Signed-off-by: Andy Shevchenko --- Documentation/devicetree/bindings/net/ieee802154/ca8210.txt | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH net-next v4 1/4] ieee802154: ca8210: Use proper setters and getters for bitwise types

2025-03-05 Thread Andy Shevchenko
Linus Walleij Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index 753215ebc67c..a036910f6082 100644 --- a/drivers/net/ieee802154/ca8

[PATCH net-next v4 2/4] ieee802154: ca8210: Get platform data via dev_get_platdata()

2025-03-05 Thread Andy Shevchenko
Access to platform data via dev_get_platdata() getter to make code cleaner. Reviewed-by: Linus Walleij Reviewed-by: Miquel Raynal Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net

Re: [PATCH net-next v3 3/3] ieee802154: ca8210: Switch to using gpiod API

2025-03-05 Thread Andy Shevchenko
On Wed, Mar 05, 2025 at 08:04:17AM +0100, Krzysztof Kozlowski wrote: > On Tue, Mar 04, 2025 at 01:22:34PM +0200, Andy Shevchenko wrote: > > This updates the driver to gpiod API, and removes yet another use of > > of_get_named_gpio(). > > > > With this, invert the logi

[PATCH net-next v3 3/3] ieee802154: ca8210: Switch to using gpiod API

2025-03-04 Thread Andy Shevchenko
This updates the driver to gpiod API, and removes yet another use of of_get_named_gpio(). With this, invert the logic of the reset pin which is active low and add a quirk for the legacy and incorrect device tree descriptions. Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko

[PATCH net-next v3 0/3] ieee802154: ca8210: Sparse fix and GPIOd conversion

2025-03-04 Thread Andy Shevchenko
) - collected tags (Miquel) Andy Shevchenko (3): ieee802154: ca8210: Use proper setter and getters for bitwise types ieee802154: ca8210: Get platform data via dev_get_platdata() ieee802154: ca8210: Switch to using gpiod API .../bindings/net/ieee802154/ca8210.txt| 2 +- drivers/gpio/gpiolib

[PATCH net-next v3 1/3] ieee802154: ca8210: Use proper setter and getters for bitwise types

2025-03-04 Thread Andy Shevchenko
Linus Walleij Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index 753215ebc67c..a036910f6082 100644 --- a/drivers/net/ieee802154/ca8

[PATCH net-next v3 2/3] ieee802154: ca8210: Get platform data via dev_get_platdata()

2025-03-04 Thread Andy Shevchenko
Access to platform data via dev_get_platdata() getter to make code cleaner. Reviewed-by: Linus Walleij Reviewed-by: Miquel Raynal Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net

Re: [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API

2025-03-04 Thread Andy Shevchenko
On Tue, Mar 04, 2025 at 01:03:41AM +0100, Linus Walleij wrote: > On Mon, Mar 3, 2025 at 9:39 PM Andy Shevchenko > wrote: > > > > Maybe add a comment in the code that this is wrong and the > > > driver and DTS files should be fixed. > > > > Or maybe fix in t

Re: [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API

2025-03-03 Thread Andy Shevchenko
Mon, Mar 03, 2025 at 09:00:39PM +0100, Linus Walleij kirjoitti: > On Mon, Mar 3, 2025 at 5:49 PM Andy Shevchenko > wrote: ... > > reinit_completion(&priv->ca8210_is_awake); > > msleep(ms); > > - gpio_set_value(pdata->gpio_reset, 1);

[PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API

2025-03-03 Thread Andy Shevchenko
This updates the driver to gpiod API, and removes yet another use of of_get_named_gpio(). Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 57 +++-- 1 file changed, 19 insertions(+), 38 deletions(-) diff --git a/drivers/net/ieee802154/ca8210.c b

[PATCH net-next v2 2/3] ieee802154: ca8210: Get platform data via dev_get_platdata()

2025-03-03 Thread Andy Shevchenko
Access to platform data via dev_get_platdata() getter to make code cleaner. Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index

[PATCH v2 0/3] ieee802154: ca8210: Sparse fix and GPIOd conversion

2025-03-03 Thread Andy Shevchenko
) - updated kernel doc for changed members (Miquel) - unfolded PTR_ERR_OR_ZERO() to the preferred pattern (Miquel) - collected tags (Miquel) Andy Shevchenko (3): ieee802154: ca8210: Use proper setter and getters for bitwise types ieee802154: ca8210: Get platform data via dev_get_platdata

[PATCH net-next v2 1/3] ieee802154: ca8210: Use proper setter and getters for bitwise types

2025-03-03 Thread Andy Shevchenko
got restricted __le16 [addressable] [usertype] pan_id Use proper setter and getters for bitwise types. Note, in accordance with [1] the protocol is little endian. Link: https://www.cascoda.com/wp-content/uploads/2018/11/CA-8210_datasheet_0418.pdf [1] Reviewed-by: Miquel Raynal Signed-off-by:

Re: [PATCH net-next v1 2/2] ieee802154: ca8210: Switch to using gpiod API

2025-03-03 Thread Andy Shevchenko
; + pdata->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); > + if (IS_ERR(pdata->reset_gpio)) { > + dev_crit(dev, "Reset GPIO did not set to output mode\n"); > +return PTR_ERR(pdata->reset_pgio); > + } > + > + return 0; Sure I can do this in v2. ... > Otherwise the rest lgtm. Thank you for the review! -- With Best Regards, Andy Shevchenko

Re: [PATCH net-next v1 1/2] ieee802154: ca8210: Use proper setter and getters for bitwise types

2025-03-03 Thread Andy Shevchenko
On Mon, Mar 03, 2025 at 05:06:32PM +0100, Miquel Raynal wrote: > On 03/03/2025 at 17:07:39 +02, Andy Shevchenko > wrote: > > > Sparse complains that the driver doesn't respect the bitwise types: > > > > drivers/net/ieee802154/ca8210.c:1796:27: warning: i

[PATCH net-next v1 0/2] ieee802154: ca8210: Sparse fix and GPIOd conversion

2025-03-03 Thread Andy Shevchenko
The main part is the patch 2 that converts the driver to GPIO descriptor APIs, the first one is just an ad-hoc fix WRT sparse complains on the bitwise types misuse. Andy Shevchenko (2): ieee802154: ca8210: Use proper setter and getters for bitwise types ieee802154: ca8210: Switch to using

[PATCH net-next v1 1/2] ieee802154: ca8210: Use proper setter and getters for bitwise types

2025-03-03 Thread Andy Shevchenko
got restricted __le16 [addressable] [usertype] pan_id Use proper setter and getters for bitwise types. Note, in accordance with [1] the protocol is little endian. Link: https://www.cascoda.com/wp-content/uploads/2018/11/CA-8210_datasheet_0418.pdf [1] Signed-off-by: Andy Shevchenko --- driver

[PATCH net-next v1 2/2] ieee802154: ca8210: Switch to using gpiod API

2025-03-03 Thread Andy Shevchenko
This updates the driver to gpiod API, and removes yet another use of of_get_named_gpio(). Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 63 - 1 file changed, 22 insertions(+), 41 deletions(-) diff --git a/drivers/net/ieee802154/ca8210.c b

Re: [PATCH v8 3/4] scanf: convert self-test to KUnit

2025-02-16 Thread Andy Shevchenko
f! I have just wasted a couple of minutes to understand what's going on in the message that is 2700 lines of text as the reply to the bot message which was ~700 lines. -- With Best Regards, Andy Shevchenko

Re: [PATCH v5 6/8] iio: light: stk3310: use dev_err_probe where possible

2025-02-12 Thread Andy Shevchenko
On Tue, Feb 11, 2025 at 07:43:11PM +, Jonathan Cameron wrote: > On Sun, 9 Feb 2025 16:47:44 +0200 > Andy Shevchenko wrote: > > On Sat, Feb 08, 2025 at 04:13:24PM -0500, Aren Moynihan wrote: > > > Using dev_err_probe instead of dev_err and return makes the errors >

Re: [PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-11 Thread Andy Shevchenko
On Tue, Feb 11, 2025 at 10:57:11AM -0500, Tamir Duberstein wrote: > On Tue, Feb 11, 2025 at 10:54 AM Andy Shevchenko > wrote: > > On Tue, Feb 11, 2025 at 10:47:03AM -0500, Tamir Duberstein wrote: > > > On Tue, Feb 11, 2025 at 10:40 AM Andy Shevchenko > > > wrote: &

Re: [PATCH v7 1/3] scanf: remove redundant debug logs

2025-02-11 Thread Andy Shevchenko
On Tue, Feb 11, 2025 at 11:02:59AM -0500, Tamir Duberstein wrote: > On Tue, Feb 11, 2025 at 10:58 AM Andy Shevchenko > wrote: > > On Tue, Feb 11, 2025 at 10:50:33AM -0500, Tamir Duberstein wrote: > > > On Tue, Feb 11, 2025 at 10:42 AM Andy Shevchenko > > > wrote: &

Re: [PATCH v7 1/3] scanf: remove redundant debug logs

2025-02-11 Thread Andy Shevchenko
On Tue, Feb 11, 2025 at 10:50:33AM -0500, Tamir Duberstein wrote: > On Tue, Feb 11, 2025 at 10:42 AM Andy Shevchenko > wrote: > > On Tue, Feb 11, 2025 at 10:13:37AM -0500, Tamir Duberstein wrote: > > > The test already prints the same information on failure; remove > >

Re: [PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-11 Thread Andy Shevchenko
On Tue, Feb 11, 2025 at 10:47:03AM -0500, Tamir Duberstein wrote: > On Tue, Feb 11, 2025 at 10:40 AM Andy Shevchenko > wrote: > > On Tue, Feb 11, 2025 at 10:13:36AM -0500, Tamir Duberstein wrote: ... > > > - Use original test assertions as KUNIT_*_EQ_MSG produces hard-to-p

Re: [PATCH v7 1/3] scanf: remove redundant debug logs

2025-02-11 Thread Andy Shevchenko
ot = (fn)(test_buffer, &endp, base); > \ > - pr_debug(#fn "(\"%s\", %d) -> " gen_fmt "\n", test_buffer, base, got); > \ > if (got != (expect)) { > \ > fail = true; > \ > pr_warn(#fn "(\"%s\", %d): got " gen_fmt " expected " gen_fmt > "\n", \ -- With Best Regards, Andy Shevchenko

Re: [PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-11 Thread Andy Shevchenko
f_kunit.c:92 > vsscanf("403/0/17/1/11e7/1/1fe8/34ba", > "%3hx/%1hx/%2hx/%1hx/%4hx/%1hx/%4hx/%4hx", ...) expected 65559 got 1507328 > not ok 5 "/" > # numbers_list_field_width_val_width: pass:0 fail:5 skip:0 total:5 > not ok 4 numbers_list_field_width_val_width > # numbers_slice: ASSERTION FAILED at lib/scanf_kunit.c:92 > vsscanf("3c87eac0f4afa1f9231da52", "%1hx%4hx%4hx%4hx%1hx%4hx%4hx%1hx", > ...) expected 1257942031 got 2886715518 -- With Best Regards, Andy Shevchenko

Re: [PATCH v6 1/2] scanf: convert self-test to KUnit

2025-02-11 Thread Andy Shevchenko
nds to. Can > you help me understand how you're testing? You are missing something. https://stackoverflow.com/a/57762255/2511795 -- With Best Regards, Andy Shevchenko

[PATCH v1 1/1] virtio_console: Get rid of unneeded temporary variable

2025-02-10 Thread Andy Shevchenko
re in use. Fix this by using dev_name() of the newly created device that is luckily the same as the string used for the DebugFS node name. Signed-off-by: Andy Shevchenko --- drivers/char/virtio_console.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers

Re: [PATCH v5 6/8] iio: light: stk3310: use dev_err_probe where possible

2025-02-09 Thread Andy Shevchenko
es for -ENOMEM. If it's in the current code, add a new patch to drop this message and return an error code directly. ... > + if (ret < 0) Perhaps, while at it, drop these ' < 0' parts where they are not hinting about anything. > + return dev_err_probe(dev, ret, "device_register failed\n"); -- With Best Regards, Andy Shevchenko

Re: [PATCH] scanf: convert self-test to KUnit

2025-01-31 Thread Andy Shevchenko
On Fri, Jan 31, 2025 at 12:25:20PM -0500, Tamir Duberstein wrote: > On Fri, Jan 31, 2025 at 12:22 PM Tamir Duberstein wrote: > > On Fri, Jan 31, 2025 at 12:11 PM Andy Shevchenko > > wrote: ... > > Can you explain what you mean by using -M -C? The formatting was done >

Re: [PATCH] scanf: convert self-test to KUnit

2025-01-31 Thread Andy Shevchenko
On Fri, Jan 31, 2025 at 12:22:39PM -0500, Tamir Duberstein wrote: > On Fri, Jan 31, 2025 at 12:11 PM Andy Shevchenko > wrote: > > On Fri, Jan 31, 2025 at 10:47:49AM -0500, Tamir Duberstein wrote: > > > Convert the scanf() self-test to a KUnit test. > > > > > &g

Re: [PATCH] scanf: convert self-test to KUnit

2025-01-31 Thread Andy Shevchenko
d remove all of them at once, if somebody wants debug configuration, they would specify it and use with help of merge_config or alike. -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 0/6] [PATCH 0/6] KUnit test moves / renames

2024-12-02 Thread Andy Shevchenko
9acd8646 ("platform/x86: intel: Add 'intel' prefix to the modules automatically") for the details how to achieve that in non-verbose way. -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 4/6] iio: light: stk3310: use dev_err_probe where possible

2024-11-12 Thread Andy Shevchenko
On Tue, Nov 12, 2024 at 12:15 PM Uwe Kleine-König wrote: > On Mon, Nov 11, 2024 at 11:44:51AM +0200, Andy Shevchenko wrote: > > On Sun, Nov 10, 2024 at 04:34:30PM -0500, Aren wrote: > > > On Sun, Nov 10, 2024 at 09:52:32PM +0200, Andy Shevchenko wrote: > > > > S

Re: [PATCH v4 4/6] iio: light: stk3310: use dev_err_probe where possible

2024-11-11 Thread Andy Shevchenko
On Sun, Nov 10, 2024 at 04:34:30PM -0500, Aren wrote: > On Sun, Nov 10, 2024 at 09:52:32PM +0200, Andy Shevchenko wrote: > > Sun, Nov 10, 2024 at 02:14:24PM -0500, Aren kirjoitti: > > > On Mon, Nov 04, 2024 at 10:40:16AM +0200, Andy Shevchenko wrote: > > > > On S

Re: [PATCH v4 2/6] iio: light: stk3310: handle all remove logic with devm callbacks

2024-11-11 Thread Andy Shevchenko
On Sun, Nov 10, 2024 at 05:37:56PM -0500, Aren wrote: > On Sun, Nov 10, 2024 at 09:51:04PM +0200, Andy Shevchenko wrote: > > Sun, Nov 10, 2024 at 01:38:39PM -0500, Aren kirjoitti: > > > On Mon, Nov 04, 2024 at 10:32:08AM +0200, Andy Shevchenko wrote: > > > > On S

Re: [PATCH v4 4/6] iio: light: stk3310: use dev_err_probe where possible

2024-11-10 Thread Andy Shevchenko
Sun, Nov 10, 2024 at 02:14:24PM -0500, Aren kirjoitti: > On Mon, Nov 04, 2024 at 10:40:16AM +0200, Andy Shevchenko wrote: > > On Sat, Nov 02, 2024 at 03:50:41PM -0400, Aren Moynihan wrote: ... > > > #define STK3310_REGFIELD(name) >

Re: [PATCH v4 2/6] iio: light: stk3310: handle all remove logic with devm callbacks

2024-11-10 Thread Andy Shevchenko
Sun, Nov 10, 2024 at 01:38:39PM -0500, Aren kirjoitti: > On Mon, Nov 04, 2024 at 10:32:08AM +0200, Andy Shevchenko wrote: > > On Sat, Nov 02, 2024 at 03:50:37PM -0400, Aren Moynihan wrote: ... > > > + ret = devm_add_action_or_reset(&client->dev, stk3310_set_s

Re: [PATCH v4 5/6] iio: light: stk3310: log error if reading the chip id fails

2024-11-04 Thread Andy Shevchenko
ke sure you have consistent style in the messages. Most of what I have seen use period at the end. This one doesn't. -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 4/6] iio: light: stk3310: use dev_err_probe where possible

2024-11-04 Thread Andy Shevchenko
gt; @@ -654,12 +652,11 @@ static int stk3310_probe(struct i2c_client *client) > int ret; > struct iio_dev *indio_dev; > struct stk3310_data *data; > + struct device *dev = &client->dev; This should has been done a few patches earlier... -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 3/6] iio: light: stk3310: Implement vdd and leda supplies

2024-11-04 Thread Andy Shevchenko
but failed to check the rest of the patch. Thanks! You may ignore my comment about RCT order if it's not that one that being commonly used in the driver. -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 3/6] iio: light: stk3310: Implement vdd and leda supplies

2024-11-04 Thread Andy Shevchenko
+ if (ret) { > + dev_err(dev, "failed to disable regulators: %d\n", ret); > + return ret; > + } ... > - u8 state = 0; > + int ret; > struct stk3310_data *data; > + u8 state = 0; Can we try to make it RCT ordered? -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 2/6] iio: light: stk3310: handle all remove logic with devm callbacks

2024-11-04 Thread Andy Shevchenko
->lock); > + devm_mutex_init(&client->dev, &data->lock); Missed error check, otherwise what's the point? Also can add a temporary variable for 'dev'. -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 5/6] iio: light: stk3310: log error if reading the chip id fails

2024-10-28 Thread Andy Shevchenko
On Mon, Oct 28, 2024 at 11:29:35AM -0400, Aren wrote: > On Mon, Oct 28, 2024 at 04:45:35PM +0200, Andy Shevchenko wrote: > > On Mon, Oct 28, 2024 at 10:19:59AM -0400, Aren Moynihan wrote: > > > If the chip isn't powered, this call is likely to return an error. > > &g

Re: [PATCH v3 3/6] iio: light: stk3310: Implement vdd and leda supplies

2024-10-28 Thread Andy Shevchenko
ile changing to RCT order here, it seems you have inconsistent approach elsewhere (in your own patches!). Please, be consistent with chosen style. > data = iio_priv(i2c_get_clientdata(to_i2c_client(dev))); -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 5/6] iio: light: stk3310: log error if reading the chip id fails

2024-10-28 Thread Andy Shevchenko
bus > isn't powered). The commit message does not explain why dev_err_probe() has been chosen and not simple dev_err(). -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 4/6] iio: light: stk3310: use dev_err_probe where possible

2024-10-28 Thread Andy Shevchenko
0) Same remark, if client is not used here, supply struct device pointer directly and make these all lines better to read. -- With Best Regards, Andy Shevchenko

Re: [PATCH RESEND] vdpa: solidrun: Fix UB bug with devres

2024-10-16 Thread Andy Shevchenko
On Wed, Oct 16, 2024 at 12:22 PM Philipp Stanner wrote: > On Wed, 2024-10-16 at 12:08 +0300, Andy Shevchenko wrote: > > On Wed, Oct 16, 2024 at 09:25:54AM +0200, Philipp Stanner wrote: ... > > > --- > > > > I haven't found the reason for resending. Can yo

Re: [PATCH RESEND] vdpa: solidrun: Fix UB bug with devres

2024-10-16 Thread Andy Shevchenko
g later ever be used, this, consequently, causes > undefined behavior since the stack frame will by then have disappeared. > > Fix the bug by allocating the strings on the heap through > devm_kasprintf(). > --- I haven't found the reason for resending. Can you elaborate

Re: [PATCH v2 2/6] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-24 Thread Andy Shevchenko
On Wed, Apr 24, 2024 at 7:14 PM Ondřej Jirman wrote: > On Wed, Apr 24, 2024 at 06:20:41PM GMT, Andy Shevchenko wrote: > > On Wed, Apr 24, 2024 at 3:59 PM Ondřej Jirman wrote: > > > On Wed, Apr 24, 2024 at 02:16:06AM GMT, Andy Shevchenko wrote: > > > > On Wed

Re: [PATCH v2 2/6] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-24 Thread Andy Shevchenko
On Wed, Apr 24, 2024 at 3:59 PM Ondřej Jirman wrote: > On Wed, Apr 24, 2024 at 02:16:06AM GMT, Andy Shevchenko wrote: > > On Wed, Apr 24, 2024 at 1:41 AM Aren Moynihan > > wrote: ... > > > ret = stk3310_init(indio_dev); > > > if (ret <

Re: [PATCH v2 2/6] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-23 Thread Andy Shevchenko
to use dev_get_drvdata() directly. Jonathan, do we have something like iio_priv_from_drvdata(struct device *dev)? Seems many drivers may utilise it. > } ... > static int stk3310_resume(struct device *dev) Ditto. -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 3/6] iio: light: stk3310: Manage LED power supply

2024-04-23 Thread Andy Shevchenko
t;dev, ret, "get regulator vdd > failed\n"); > > + data->led_reg = devm_regulator_get(&client->dev, "leda"); > + if (IS_ERR(data->led_reg)) > + return dev_err_probe(&client->dev, ret, "get regulator led > failed\n"); Can't you use a bulk regulator API instead? -- With Best Regards, Andy Shevchenko

Re: [PATCH 2/4] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-18 Thread Andy Shevchenko
On Thu, Apr 18, 2024 at 8:50 PM Aren wrote: > On Thu, Apr 18, 2024 at 06:56:09PM +0300, Andy Shevchenko wrote: > > On Thu, Apr 18, 2024 at 6:06 PM Aren wrote: > > > On Mon, Apr 15, 2024 at 05:04:53PM +0300, Andy Shevchenko wrote: > > > > On Sun, Apr 14,

Re: [PATCH 2/4] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-18 Thread Andy Shevchenko
On Thu, Apr 18, 2024 at 6:06 PM Aren wrote: > On Mon, Apr 15, 2024 at 05:04:53PM +0300, Andy Shevchenko wrote: > > On Sun, Apr 14, 2024 at 8:57 PM Aren Moynihan > > wrote: ... > > > stk3310_set_state(iio_priv(indio_dev), STK3310_STATE_STANDBY); > &g

Re: [PATCH 3/4] iio: light: stk3310: log error if reading the chip id fails

2024-04-15 Thread Andy Shevchenko
} Briefly looking at the code it seems that this one is strictly part of the probe phase, which means we may use return dev_err_probe(...); pattern. Yet, you may add another patch to clean up all of them: _probe(), _init(), _regmap_init() to use the same pattern everywhere. -- With Best Regards, Andy Shevchenko

Re: [PATCH 2/4] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-15 Thread Andy Shevchenko
able(data->vdd_reg); I forgot to check the order of freeing resources, be sure you have no devm_*() releases happening before this call. ... > + usleep_range(1000, 2000); fsleep() -- With Best Regards, Andy Shevchenko

Re: [PATCH] [v3] module: don't ignore sysfs_create_link() failures

2024-03-26 Thread Andy Shevchenko
es of code this can be improved beforehand. So, we will reduce a technical debt, and not adding to it. > + goto out_detach; > + } ... > +int module_add_driver(struct module *mod, struct device_driver *drv) > { > char *driver_name; > - int no_warn; > + int ret; I would move it... > struct module_kobject *mk = NULL; ...to be here. -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 1/1] ACPI: NFIT: Switch to use acpi_evaluate_dsm_typed()

2024-02-02 Thread Andy Shevchenko
On Mon, Nov 20, 2023 at 07:19:44PM +0200, Andy Shevchenko wrote: > On Mon, Nov 20, 2023 at 04:11:54PM +0100, Rafael J. Wysocki wrote: > > On Mon, Nov 20, 2023 at 4:03 PM Andy Shevchenko > > wrote: > > > On Thu, Oct 19, 2023 at 06:03:28PM -0700, Dan Williams wrote: >

Re: [PATCH] tracing histograms: Simplify parse_actions() function

2024-01-08 Thread Andy Shevchenko
27;) { // not sure if you need data to be assigned here as well ret = -EINVAL; ... } -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 0/5] params: harden string ops and allocatio ops

2023-12-01 Thread Andy Shevchenko
On Fri, Dec 01, 2023 at 09:43:34AM -0800, Kees Cook wrote: > On Mon, 20 Nov 2023 17:11:41 +0200, Andy Shevchenko wrote: > > A couple of patches are for get the string ops, used in the module, > > slightly harden. On top a few cleanups. > > > > Since the main part is ra

Re: [PATCH v3 0/5] params: harden string ops and allocatio ops

2023-12-01 Thread Andy Shevchenko
On Mon, Nov 20, 2023 at 05:11:41PM +0200, Andy Shevchenko wrote: > A couple of patches are for get the string ops, used in the module, > slightly harden. On top a few cleanups. > > Since the main part is rather hardening, I think the Kees' tree is > the best fit for the seri

[PATCH v3 2/5] params: Do not go over the limit when getting the string length

2023-11-20 Thread Andy Shevchenko
We can use strnlen() even on early stages and it prevents from going over the string boundaries in case it's already too long. Reviewed-by: Luis Chamberlain Reviewed-by: Kees Cook Signed-off-by: Andy Shevchenko --- kernel/params.c | 9 ++--- 1 file changed, 6 insertions(+), 3 dele

[PATCH v3 4/5] params: Sort headers

2023-11-20 Thread Andy Shevchenko
Sort the headers in alphabetic order in order to ease the maintenance for this part. Reviewed-by: Luis Chamberlain Reviewed-by: Kees Cook Signed-off-by: Andy Shevchenko --- kernel/params.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/kernel/params.c b

[PATCH v3 5/5] params: Fix multi-line comment style

2023-11-20 Thread Andy Shevchenko
The multi-line comment style in the file is rather arbitrary. Make it follow the standard one. Reviewed-by: Luis Chamberlain Reviewed-by: Kees Cook Signed-off-by: Andy Shevchenko --- kernel/params.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a

[PATCH v3 1/5] params: Introduce the param_unknown_fn type

2023-11-20 Thread Andy Shevchenko
Introduce a new type for the callback to parse an unknown argument. This unifies function prototypes which takes that as a parameter. Reviewed-by: Luis Chamberlain Reviewed-by: Kees Cook Signed-off-by: Andy Shevchenko --- include/linux/moduleparam.h | 6 +++--- kernel/params.c | 8

[PATCH v3 3/5] params: Use size_add() for kmalloc()

2023-11-20 Thread Andy Shevchenko
Prevent allocations from integer overflow by using size_add(). Reviewed-by: Luis Chamberlain Reviewed-by: Kees Cook Signed-off-by: Andy Shevchenko --- kernel/params.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/params.c b/kernel/params.c index f8e3c4139854

[PATCH v3 0/5] params: harden string ops and allocatio ops

2023-11-20 Thread Andy Shevchenko
ute for the series (Luis) Andy Shevchenko (5): params: Introduce the param_unknown_fn type params: Do not go over the limit when getting the string length params: Use size_add() for kmalloc() params: Sort headers params: Fix multi-line comment style include/linux/moduleparam.h | 6 ++-

Re: [PATCH v1 1/1] ACPI: NFIT: Switch to use acpi_evaluate_dsm_typed()

2023-11-20 Thread Andy Shevchenko
On Thu, Oct 19, 2023 at 06:03:28PM -0700, Dan Williams wrote: > Andy Shevchenko wrote: > > The acpi_evaluate_dsm_typed() provides a way to check the type of the > > object evaluated by _DSM call. Use it instead of open coded variant. > > Looks good to me. > > Review

Re: [PATCH v1 1/1] ACPI: NFIT: Switch to use acpi_evaluate_dsm_typed()

2023-10-19 Thread Andy Shevchenko
On Mon, Oct 02, 2023 at 04:54:58PM +0300, Andy Shevchenko wrote: > The acpi_evaluate_dsm_typed() provides a way to check the type of the > object evaluated by _DSM call. Use it instead of open coded variant. Dan, do you have any comments? -- With Best Regards, Andy Shevchenko

Re: [PATCH v2] ACPI: NFIT: Fix local use of devm_*()

2023-10-14 Thread Andy Shevchenko
for educational purposes." -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 3/6] ACPI: AC: Replace acpi_driver with platform_driver

2023-10-07 Thread Andy Shevchenko
you really need to get from ac to > the underlying platform device, a pointer to it can be added to struct > acpi_ac without removing the ACPI device pointer from it. The idea behind is to eliminate data duplication. > > unsigned long long state; > > struct notifier_block battery_nb; > > }; -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 3/6] ACPI: AC: Replace acpi_driver with platform_driver

2023-10-06 Thread Andy Shevchenko
switch (event) { > default: > - acpi_handle_debug(device->handle, "Unsupported event [0x%x]\n", > + acpi_handle_debug(ACPI_HANDLE(ac->dev), "Unsupported event > [0x%x]\n", > event); Does it makes any sense now? Basically it duplicates the ACPI_COMPANION() call as Rafael pointed out in previous version discussion. > fallthrough; -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 1/1] ACPI: NFIT: Switch to use acpi_evaluate_dsm_typed()

2023-10-03 Thread Andy Shevchenko
On Mon, Oct 02, 2023 at 10:27:02PM +0200, Wilczynski, Michal wrote: > On 10/2/2023 3:54 PM, Andy Shevchenko wrote: ... > > + out_obj = acpi_evaluate_dsm_typed(handle, guid, revid, func, &in_obj, > > ACPI_TYPE_BUFFER); > > This line is 90 characters long, wouldn&#

[PATCH v1 1/1] ACPI: NFIT: Switch to use acpi_evaluate_dsm_typed()

2023-10-02 Thread Andy Shevchenko
The acpi_evaluate_dsm_typed() provides a way to check the type of the object evaluated by _DSM call. Use it instead of open coded variant. Signed-off-by: Andy Shevchenko --- drivers/acpi/nfit/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/nfit

[PATCH v2 4/5] params: Sort headers

2023-10-02 Thread Andy Shevchenko
Sort the headers in alphabetic order in order to ease the maintenance for this part. Signed-off-by: Andy Shevchenko --- kernel/params.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/params.c b/kernel/params.c index c3a029fe183d..eb55b32399b4 100644

[PATCH v2 1/5] params: Introduce the param_unknown_fn type

2023-10-02 Thread Andy Shevchenko
Introduce a new type for the callback to parse an unknown argument. This unifies function prototypes which takes that as a parameter. Signed-off-by: Andy Shevchenko --- include/linux/moduleparam.h | 6 +++--- kernel/params.c | 8 ++-- 2 files changed, 5 insertions(+), 9

[PATCH v2 3/5] params: Use size_add() for kmalloc()

2023-10-02 Thread Andy Shevchenko
Prevent allocations from integer overflow by using size_add(). Signed-off-by: Andy Shevchenko --- kernel/params.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/params.c b/kernel/params.c index f8e3c4139854..c3a029fe183d 100644 --- a/kernel/params.c +++ b/kernel

[PATCH v2 0/5] params: harden string ops and allocatio ops

2023-10-02 Thread Andy Shevchenko
t; sysfs_emit() conversion as it revealed an issue, i.e. reuse getters with non-page-aligned pointer, which would be addressed separately - added cover letter and clarified the possible route for the series (Luis) Andy Shevchenko (5): params: Introduce the param_unknown_fn type params: Do no

[PATCH v2 2/5] params: Do not go over the limit when getting the string length

2023-10-02 Thread Andy Shevchenko
We can use strnlen() even on early stages and it prevents from going over the string boundaries in case it's already too long. Signed-off-by: Andy Shevchenko --- kernel/params.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/params.c b/kernel/params.c

[PATCH v2 5/5] params: Fix multi-line comment style

2023-10-02 Thread Andy Shevchenko
The multi-line comment style in the file is rather arbitrary. Make it follow the standard one. Signed-off-by: Andy Shevchenko --- kernel/params.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/kernel/params.c b/kernel/params.c index eb55b32399b4

Re: [PATCH v1 2/2] ACPI: NFIT: Use modern scope based rollback

2023-10-02 Thread Andy Shevchenko
On Tue, Sep 26, 2023 at 09:45:20PM +0300, Michal Wilczynski wrote: > Change rollback in acpi_nfit_init_interleave_set() to use modern scope > based attribute __free(). This is similar to C++ RAII and is a preferred > way for handling local memory allocations. LGTM, Reviewed-by: Andy S

Re: [PATCH v1 1/2] ACPI: NFIT: Fix memory leak, and local use of devm_*()

2023-10-02 Thread Andy Shevchenko
'local leak'. > > Fix this by switching from devm_kcalloc() to kcalloc(), and adding > proper rollback. LGTM, Reviewed-by: Andy Shevchenko -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 9/9] ACPI: NFIT: Don't use KBUILD_MODNAME for driver name

2023-09-25 Thread Andy Shevchenko
we won't have any users outside of existing model (instantiating via ACPI ID). All the above is "strictly speaking"... -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 1/1] lib/string_helpers: Don't copy a tail in kstrdup_and_replace() if 'new' is \0

2023-09-14 Thread Andy Shevchenko
On Wed, Sep 13, 2023 at 12:45:57PM +0300, Andy Shevchenko wrote: > The kstrdup_and_replace() takes two characters, old and new, to replace > former with latter after the copying of the original string. But in case > when new is a NUL, there is no point to copy the rest of the stri

[PATCH v1 1/1] lib/string_helpers: Don't copy a tail in kstrdup_and_replace() if 'new' is \0

2023-09-13 Thread Andy Shevchenko
string and not a buffer of the size filled with a given data. With this we can optimize the memory consumption by copying only meaningful part of the original string and drop the rest. Signed-off-by: Andy Shevchenko --- The first user of this is pending: https://lore.kernel.org/platform-driver-x86

Re: [PATCH] nvdimm: Replace the usage of a variable by a direct function call in nd_pfn_validate()

2023-04-14 Thread Andy Shevchenko
mcmp() with uuid_equal(). > return -ENODEV; -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 1/1] nvdimm/namespace: return uuid_null only once in nd_dev_to_uuid()

2022-07-14 Thread Andy Shevchenko
On Thu, Jul 14, 2022 at 11:24:05AM -0700, Dan Williams wrote: > Andy Shevchenko wrote: > > Refactor nd_dev_to_uuid() in order to make code shorter and cleaner > > by joining conditions and hence returning uuid_null only once. > > Apologies for the delay, applied for v5.20.

Re: [PATCH v1 1/1] nvdimm/namespace: drop nested variable in create_namespace_pmem()

2022-06-21 Thread Andy Shevchenko
On Tue, Jun 07, 2022 at 07:49:37PM +0300, Andy Shevchenko wrote: > Kernel build bot reported: > > namespace_devs.c:1991:10: warning: Local variable 'uuid' shadows outer > variable [shadowVariable] > > Refactor create_namespace_pmem() by dropping a nested version

[PATCH v1 1/1] nvdimm/namespace: drop nested variable in create_namespace_pmem()

2022-06-07 Thread Andy Shevchenko
rted-by: kernel test robot Signed-off-by: Andy Shevchenko --- drivers/nvdimm/namespace_devs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c index 0f863fda56e6..dfade66bab73 100644 --- a/drivers/nvdimm/namespace_devs.c

  1   2   3   4   5   6   7   8   9   10   >