linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] regulator: Use container_of_const() when all types are const
@ 2025-11-26 16:58 Krzysztof Kozlowski
  2025-11-26 16:58 ` [PATCH 1/8] " Krzysztof Kozlowski
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-26 16:58 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Bartosz Golaszewski, Matthias Brugger,
	AngeloGioacchino Del Regno, Samuel Kayode, Matti Vaittinen
  Cc: linux-kernel, linux-arm-kernel, linux-mediatek, imx,
	Krzysztof Kozlowski

Use container_of_const(), which is preferred over container_of(), when
the argument 'ptr' and returned pointer are already const, for better
code safety and readability.

Some drivers already have const everywhere, so container_of_const can be
directly used. In few other drivers, the final pointer can be constified
that way.

Best regards,
Krzysztof

---
Krzysztof Kozlowski (8):
      regulator: Use container_of_const() when all types are const
      regulator: bd71815: Constify pointers to 'regulator_desc' wrap struct
      regulator: bd71828: Constify pointers to 'regulator_desc' wrap struct
      regulator: bd718x7: Constify pointers to 'regulator_desc' wrap struct
      regulator: bd96801: Constify pointers to 'regulator_desc' wrap struct
      regulator: mt6358: Constify pointers to 'regulator_desc' wrap struct
      regulator: pca9450: Constify pointers to 'regulator_desc' wrap struct
      regulator: pf9453: Constify pointers to 'regulator_desc' wrap struct

 drivers/regulator/bd71815-regulator.c    |  8 ++++----
 drivers/regulator/bd71828-regulator.c    |  4 ++--
 drivers/regulator/bd718x7-regulator.c    |  4 ++--
 drivers/regulator/bd96801-regulator.c    | 10 +++++-----
 drivers/regulator/hi6421-regulator.c     | 10 +++++-----
 drivers/regulator/hi6421v530-regulator.c |  4 ++--
 drivers/regulator/hi6421v600-regulator.c |  6 +++---
 drivers/regulator/max77650-regulator.c   |  6 +++---
 drivers/regulator/mt6315-regulator.c     |  6 +++---
 drivers/regulator/mt6358-regulator.c     |  2 +-
 drivers/regulator/pca9450-regulator.c    |  8 ++++----
 drivers/regulator/pf1550-regulator.c     | 24 ++++++++++++------------
 drivers/regulator/pf9453-regulator.c     |  4 +++-
 13 files changed, 49 insertions(+), 47 deletions(-)
---
base-commit: 353fda3a1168e7e38ea541c14c4e858c78cd2018
change-id: 20251126-container-of-const-regulator-20e240c45b78

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>



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

end of thread, other threads:[~2025-11-26 22:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-26 16:58 [PATCH 0/8] regulator: Use container_of_const() when all types are const Krzysztof Kozlowski
2025-11-26 16:58 ` [PATCH 1/8] " Krzysztof Kozlowski
2025-11-26 17:33   ` Mark Brown
2025-11-26 17:37     ` Krzysztof Kozlowski
2025-11-26 18:45       ` Mark Brown
2025-11-26 16:58 ` [PATCH 2/8] regulator: bd71815: Constify pointers to 'regulator_desc' wrap struct Krzysztof Kozlowski
2025-11-26 16:58 ` [PATCH 3/8] regulator: bd71828: " Krzysztof Kozlowski
2025-11-26 16:58 ` [PATCH 4/8] regulator: bd718x7: " Krzysztof Kozlowski
2025-11-26 16:58 ` [PATCH 5/8] regulator: bd96801: " Krzysztof Kozlowski
2025-11-26 16:58 ` [PATCH 6/8] regulator: mt6358: " Krzysztof Kozlowski
2025-11-26 16:58 ` [PATCH 7/8] regulator: pca9450: " Krzysztof Kozlowski
2025-11-26 16:58 ` [PATCH 8/8] regulator: pf9453: " Krzysztof Kozlowski
2025-11-26 22:05 ` [PATCH 0/8] regulator: Use container_of_const() when all types are const Mark Brown

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).