Skip to contentSkip to conversation

of: property: Fix documentation for out values

PATCH Superseded Matti Vaittinen 2 participants 2 messages Nov 12, 2019 – Nov 13, 2019 Device tree

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of: property: Fix documentation for out values

Property fetching functions which return number of successfully fetched properties should not state that out-values are only modified if 0 is returned. Fix this.

---
 drivers/of/property.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/of/property.c +8 -4
index d7fa75e31f22..4aae93cdc1ce 100644
@@ -164,7 +164,8 @@ EXPORT_SYMBOL_GPL(of_property_read_u64_index);
  *
  * @np:		device node from which the property value is to be read.
  * @propname:	name of the property to be searched.
- * @out_values:	pointer to return value, modified only if return value is 0.
+ * @out_values:	pointer to return value, modified only if return value is
+ *		greater than 0.
  * @sz_min:	minimum number of array elements to read
  * @sz_max:	maximum number of array elements to read, if zero there is no
  *		upper limit on the number of elements in the dts entry but only
@@ -212,7 +213,8 @@ EXPORT_SYMBOL_GPL(of_property_read_variable_u8_array);
  *
  * @np:		device node from which the property value is to be read.
  * @propname:	name of the property to be searched.
- * @out_values:	pointer to return value, modified only if return value is 0.
+ * @out_values:	pointer to return value, modified only if return value is
+ *		greater than 0.
  * @sz_min:	minimum number of array elements to read
  * @sz_max:	maximum number of array elements to read, if zero there is no
  *		upper limit on the number of elements in the dts entry but only
@@ -260,7 +262,8 @@ EXPORT_SYMBOL_GPL(of_property_read_variable_u16_array);
  *
  * @np:		device node from which the property value is to be read.
  * @propname:	name of the property to be searched.
- * @out_values:	pointer to return value, modified only if return value is 0.
+ * @out_values:	pointer to return value, modified only if return value is
+ *		greater than 0.
  * @sz_min:	minimum number of array elements to read
  * @sz_max:	maximum number of array elements to read, if zero there is no
  *		upper limit on the number of elements in the dts entry but only
@@ -334,7 +337,8 @@ EXPORT_SYMBOL_GPL(of_property_read_u64);
  *
  * @np:		device node from which the property value is to be read.
  * @propname:	name of the property to be searched.
- * @out_values:	pointer to return value, modified only if return value is 0.
+ * @out_values:	pointer to return value, modified only if return value is
+ *		greater than 0.
  * @sz_min:	minimum number of array elements to read
  * @sz_max:	maximum number of array elements to read, if zero there is no
  *		upper limit on the number of elements in the dts entry but only
Signature · 14 lines
2.21.0


-- 
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =] 
#1 lore raw

Hi Matti,

Quoted 45 lines · Matti Vaittinen

Property fetching functions which return number of successfully fetched properties should not state that out-values are only modified if 0 is returned. Fix this.

---
 drivers/of/property.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/of/property.c +6 -3
index d7fa75e31f22..4aae93cdc1ce 100644
@@ -164,7 +164,8 @@ EXPORT_SYMBOL_GPL(of_property_read_u64_index);
  *
  * @np:		device node from which the property value is to be read.
  * @propname:	name of the property to be searched.
- * @out_values:	pointer to return value, modified only if return value is 0.
+ * @out_values:	pointer to return value, modified only if return value is
+ *		greater than 0.
  * @sz_min:	minimum number of array elements to read
  * @sz_max:	maximum number of array elements to read, if zero there is no
  *		upper limit on the number of elements in the dts entry but only
@@ -212,7 +213,8 @@ EXPORT_SYMBOL_GPL(of_property_read_variable_u8_array);
  *
  * @np:		device node from which the property value is to be read.
  * @propname:	name of the property to be searched.
- * @out_values:	pointer to return value, modified only if return value is 0.
+ * @out_values:	pointer to return value, modified only if return value is
+ *		greater than 0.
  * @sz_min:	minimum number of array elements to read
  * @sz_max:	maximum number of array elements to read, if zero there is no
  *		upper limit on the number of elements in the dts entry but only
@@ -260,7 +262,8 @@ EXPORT_SYMBOL_GPL(of_property_read_variable_u16_array);
  *
  * @np:		device node from which the property value is to be read.
  * @propname:	name of the property to be searched.
- * @out_values:	pointer to return value, modified only if return value is 0.
+ * @out_values:	pointer to return value, modified only if return value is
+ *		greater than 0.
  * @sz_min:	minimum number of array elements to read
  * @sz_max:	maximum number of array elements to read, if zero there is no
  *		upper limit on the number of elements in the dts entry but only

drivers/of/property.c EXPORT_SYMBOL_GPL(of_property_read_u64); · line 344

Quoted 9 lines
drivers/of/property.c +2 -1
@@ -334,7 +337,8 @@ EXPORT_SYMBOL_GPL(of_property_read_u64);
  *
  * @np:		device node from which the property value is to be read.
  * @propname:	name of the property to be searched.
- * @out_values:	pointer to return value, modified only if return value is 0.
+ * @out_values:	pointer to return value, modified only if return value is
+ *		greater than 0.
  * @sz_min:	minimum number of array elements to read
  * @sz_max:	maximum number of array elements to read, if zero there is no
  *		upper limit on the number of elements in the dts entry but only

Thanks for catching each of these cases of incorrect documentation.

Instead of correcting each of the descriptions, please just remove the incorrect portion. So for each case, remove ", modified only if return value is 0."

The reference to return value of 0 is a left over from another set of functions which were modified to call the set of functions that you fix above.

Thanks,

Frank