linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] devres: provide and use devm_krealloc()
@ 2020-06-29  6:50 Bartosz Golaszewski
  2020-06-29  6:50 ` [PATCH v2 1/6] devres: remove stray space from devm_kmalloc() definition Bartosz Golaszewski
                   ` (6 more replies)
  0 siblings, 7 replies; 24+ messages in thread
From: Bartosz Golaszewski @ 2020-06-29  6:50 UTC (permalink / raw)
  To: Jonathan Corbet, Greg Kroah-Hartman, Rafael J . Wysocki,
	Guenter Roeck, Jean Delvare
  Cc: linux-doc, linux-kernel, linux-hwmon, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Regular krealloc() obviously can't work with managed memory. This series
implements devm_krealloc() and adds the first user with hope that this
helper will be adopted by other drivers currently using non-managed
krealloc().

Some additional changes to the code modified by main patches are included.

v1 -> v2:
- remove leftover call to hwmon_device_unregister() from pmbus_core.c
- add a patch extending devm_kmalloc() to handle zero size case
- use WARN_ON() instead of WARN_ONCE() in devm_krealloc() when passed
  a pointer to non-managed memory
- correctly handle the case when devm_krealloc() is passed a pointer to
  memory in .rodata (potentially returned by devm_kstrdup_const())
- correctly handle ZERO_SIZE_PTR passed as the ptr argument in devm_krealloc()

Bartosz Golaszewski (6):
  devres: remove stray space from devm_kmalloc() definition
  devres: move the size check from alloc_dr() into a separate function
  device: remove 'extern' attribute from function prototypes in device.h
  devres: handle zero size in devm_kmalloc()
  devres: provide devm_krealloc()
  hwmon: pmbus: use more devres helpers

 .../driver-api/driver-model/devres.rst        |   1 +
 drivers/base/devres.c                         |  75 +++++-
 drivers/hwmon/pmbus/pmbus_core.c              |  28 +--
 include/linux/device.h                        | 225 +++++++++---------
 4 files changed, 187 insertions(+), 142 deletions(-)

-- 
2.26.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2021-04-12 19:23 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29  6:50 [PATCH v2 0/6] devres: provide and use devm_krealloc() Bartosz Golaszewski
2020-06-29  6:50 ` [PATCH v2 1/6] devres: remove stray space from devm_kmalloc() definition Bartosz Golaszewski
2020-06-29  6:50 ` [PATCH v2 2/6] devres: move the size check from alloc_dr() into a separate function Bartosz Golaszewski
2020-06-29  6:50 ` [PATCH v2 3/6] device: remove 'extern' attribute from function prototypes in device.h Bartosz Golaszewski
2020-06-29  6:50 ` [PATCH v2 4/6] devres: handle zero size in devm_kmalloc() Bartosz Golaszewski
2020-07-10 13:46   ` Jon Hunter
2020-07-10 16:03     ` Bartosz Golaszewski
2020-07-10 16:11       ` Jon Hunter
2020-07-10 16:24         ` Bartosz Golaszewski
2020-07-10 16:30           ` Jon Hunter
2021-04-11  3:21   ` Dmitry Torokhov
2021-04-12 19:23     ` Bartosz Golaszewski
2020-06-29  6:50 ` [PATCH v2 5/6] devres: provide devm_krealloc() Bartosz Golaszewski
2020-07-02 12:42   ` Greg Kroah-Hartman
2020-07-02 13:11     ` Bartosz Golaszewski
2020-07-06 16:38       ` Bartosz Golaszewski
2020-07-06 16:41         ` Greg Kroah-Hartman
2020-07-10 13:32         ` Greg Kroah-Hartman
2020-06-29  6:50 ` [PATCH v2 6/6] hwmon: pmbus: use more devres helpers Bartosz Golaszewski
2020-06-29 16:32   ` Guenter Roeck
2020-07-02 12:44   ` Greg Kroah-Hartman
2020-07-02 13:06     ` Bartosz Golaszewski
2020-07-02 14:29     ` Guenter Roeck
2020-07-02 12:44 ` [PATCH v2 0/6] devres: provide and use devm_krealloc() Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).