Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [libgpiod]: feature request: API functions, const correctness
@ 2023-08-02 14:06 Hollerer Franz, Schrack Seconet AG, Entwicklung
  2023-08-12 18:42 ` Bartosz Golaszewski
  0 siblings, 1 reply; 4+ messages in thread
From: Hollerer Franz, Schrack Seconet AG, Entwicklung @ 2023-08-02 14:06 UTC (permalink / raw)
  To: linux-gpio@vger.kernel.org
  Cc: Hollerer Franz, Schrack Seconet AG, Entwicklung,
	Ullrich Lucas, Schrack Seconet AG, Entwicklung

Dear libgpiod-team,

I have a request, and it would be great if you could consider it for future versions of libgpiod. Within the current API it is not obvious which function parameters are input-only parameters, and which parameter are output parameters, i.e., will be modified.

I think it would be helpful if the API is const correct. As example, I think

> struct gpiod_line_info *gpiod_chip_get_line_info(struct gpiod_chip *chip,
> 						 unsigned int offset);

should be changed to

> struct gpiod_line_info *gpiod_chip_get_line_info(const struct gpiod_chip *chip,
> 						 unsigned int offset);

making it clear that the chip object is an input parameter which is not changed by the API function. Same argument applies for many other API functions...

Thanks for consideration & Best regards,

Franz Hollerer


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-14  9:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-02 14:06 [libgpiod]: feature request: API functions, const correctness Hollerer Franz, Schrack Seconet AG, Entwicklung
2023-08-12 18:42 ` Bartosz Golaszewski
2023-08-14  8:16   ` Hollerer Franz, Schrack Seconet AG, Entwicklung
2023-08-14  9:56     ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox