Skip to contentSkip to conversation

spi: <linux/spi/spi.h>: add missing struct kernel-doc entry

PATCH Superseded Randy Dunlap 2 participants 3 messages Jun 28, 2021 SPI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: <linux/spi/spi.h>: add missing struct kernel-doc entry

Fix kernel-doc warning in spi.h:

../include/linux/spi/spi.h:673: warning: Function parameter or member 'devm_allocated' not described in 'spi_controller'

Fixes 794aaf01444d ("spi: Fix use-after-free with devm_spi_alloc_*")
Cc William A. Kennington III <[email protected]>
Cc Mark Brown <[email protected]>
---
 include/linux/spi/spi.h |    1 +
 1 file changed, 1 insertion(+)
include/linux/spi/spi.h +1 -0
@@ -339,6 +339,7 @@ extern struct spi_device *spi_new_ancill
  * @max_speed_hz: Highest supported transfer speed
  * @flags: other constraints relevant to this driver
  * @slave: indicates that this is an SPI slave controller
+ * @devm_allocated: flag indicating this is a non-devres managed controller
  * @max_transfer_size: function that returns the max transfer size for
  *	a &spi_device; may be %NULL, so the default %SIZE_MAX will be used.
  * @max_message_size: function that returns the max message size for
#1 lore raw

include/linux/spi/spi.h extern struct spi_device *spi_new_ancill · line 342

Quoted 7 lines · Randy Dunlap
include/linux/spi/spi.h +1 -0
@@ -339,6 +339,7 @@ extern struct spi_device *spi_new_ancill
  * @max_speed_hz: Highest supported transfer speed
  * @flags: other constraints relevant to this driver
  * @slave: indicates that this is an SPI slave controller
+ * @devm_allocated: flag indicating this is a non-devres managed controller

Actually the flag indicates that the *allocation* of the controller *is* devres-managed, so instead of the above I'd suggest something along the lines of:

* @devm_allocated: whether allocation of this struct is devres-managed

Thanks,

Lukas

#2 lore raw
Quoted 13 lines · Lukas Wunner

include/linux/spi/spi.h extern struct spi_device *spi_new_ancill · line 342

Quoted 7 lines · Randy Dunlap
include/linux/spi/spi.h +1 -0
@@ -339,6 +339,7 @@ extern struct spi_device *spi_new_ancill
  * @max_speed_hz: Highest supported transfer speed
  * @flags: other constraints relevant to this driver
  * @slave: indicates that this is an SPI slave controller
+ * @devm_allocated: flag indicating this is a non-devres managed controller

Actually the flag indicates that the *allocation* of the controller *is* devres-managed, so instead of the above I'd suggest something along the lines of:

Quoted 3 lines

* @devm_allocated: whether allocation of this struct is devres-managed

Thanks,

Hi Lukas,

OK, I'll change it like that.
I had just copied a comment from below in that same file. I think that I should fix that comment as well.

Thanks.