Re: [PATCH v7 1/4] gpiolib: Pass bitmaps, not integer arrays, to get/set array

From
Lukas Wunner <lukas@wunner.de>
Date
2018-09-02 13:22:03
Also in
linux-doc, linux-gpio, linux-i2c, linux-iio, linux-mmc, linux-serial, lkml
Reply to
Janusz Krzysztofik, 2018-09-02
On Sun, Sep 02, 2018 at 02:01:41PM +0200, Janusz Krzysztofik wrote:
quoted hunk ↗ jump to hunk
@@ -461,7 +461,7 @@ static long linehandle_ioctl(struct file *filep, unsigned int cmd,
 
 		/* Clamp all values to [0,1] */
 		for (i = 0; i < lh->numdescs; i++)
-			vals[i] = !!ghd.values[i];
+			__assign_bit(i, vals, !!ghd.values[i]);
The "!!" becomes unnecessary and can be removed, same for the code
comment above.

quoted hunk ↗ jump to hunk
 /**
  * gpiod_get_array_value() - read values from an array of GPIOs
- * @array_size: number of elements in the descriptor / value arrays
+ * @array_size: number of elements in the descriptor array / value bitmap
  * @desc_array: array of GPIO descriptors whose values will be read
- * @value_array: array to store the read values
+ * @value_bitnap: bitmap to store the read values
Typo, s/bitnap/bitmap/

Otherwise LGTM.
Thread (75 messages) 75 messages, 12 authors, last reply 2018-10-01
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help