[libgpiod PATCH] core: Fix gpiod_line_bulk_reset type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



bulk->lines is an array of pointers, so it doesn't matter which pointer
type we specify to sizeof(). As it's a struct gpiod_line *, it would
make sense to use that.

Signed-off-by: Joel Stanley <joel@xxxxxxxxx>
---

Alternately, we could make this sizeof(*bulk->lines).

 lib/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/core.c b/lib/core.c
index 2e7ee4b5b896..6ef09baec0f5 100644
--- a/lib/core.c
+++ b/lib/core.c
@@ -117,7 +117,7 @@ GPIOD_API struct gpiod_line_bulk *gpiod_line_bulk_new(unsigned int max_lines)
 GPIOD_API void gpiod_line_bulk_reset(struct gpiod_line_bulk *bulk)
 {
 	bulk->num_lines = 0;
-	memset(bulk->lines, 0, bulk->max_lines * sizeof(struct line *));
+	memset(bulk->lines, 0, bulk->max_lines * sizeof(struct gpiod_line *));
 }
 
 GPIOD_API void gpiod_line_bulk_free(struct gpiod_line_bulk *bulk)
-- 
2.34.1




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux