All of lore.kernel.org
 help / color / mirror / Atom feed
* [IIO] Help understanding iio_priv(..)
@ 2017-03-13 20:15 Aishwarya Pant
  2017-03-14 12:43 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Aishwarya Pant @ 2017-03-13 20:15 UTC (permalink / raw)
  To: outreachy-kernel

Hi

I have been looking at the IIO task and came across this function
iio_priv(..). It is defined as-


static inline void *iio_priv(const struct iio_dev *indio_dev)
{
        return (char *)indio_dev + ALIGN(sizeof(struct iio_dev),
	IIO_ALIGN);
}

It returns a void pointer and used as struct dev_state = iio_priv(indio_dev).
Looks like it is used to store an iio device state private to the file.

Could someone help me understand what exactly is happening inside here?

Thanks
Aishwarya





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

end of thread, other threads:[~2017-03-14 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-13 20:15 [IIO] Help understanding iio_priv(..) Aishwarya Pant
2017-03-14 12:43 ` [Outreachy kernel] " Julia Lawall
2017-03-13 22:09   ` Aishwarya Pant

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.