gpiod.h: improve the documentation for gpiod_line_iter_last_offset()
authorBartosz Golaszewski <bartekgola@gmail.com>
Fri, 14 Jul 2017 11:25:40 +0000 (13:25 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Fri, 14 Jul 2017 11:25:40 +0000 (13:25 +0200)
Mention the undefined behavior if gpiod_line_iter_last_offset() is
ever called before gpiod_line_iter_next().

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
include/gpiod.h

index 725551baf4e69bda84702329da1518d5e7a2a9f8..d56fb4d67cd0ef318fde04a73d293240406c6cee 100644 (file)
@@ -1082,6 +1082,9 @@ static inline bool gpiod_line_iter_err(const struct gpiod_line_iter *iter)
  * @param iter The GPIO line iterator object.
  * @return The offset of the last line we tried to open - whether we failed
  *         or succeeded to do so.
+ *
+ * If this function is called before gpiod_line_iter_next() is called at least
+ * once, the results are undefined.
  */
 static inline unsigned int
 gpiod_line_iter_last_offset(const struct gpiod_line_iter *iter)