All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aishwarya Pant <aishpant@gmail.com>
To: outreachy-kernel@googlegroups.com
Subject: [IIO] Help understanding iio_priv(..)
Date: Tue, 14 Mar 2017 01:45:11 +0530	[thread overview]
Message-ID: <20170313201511.GA12957@aishwarya> (raw)

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





             reply	other threads:[~2017-03-14 12:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-13 20:15 Aishwarya Pant [this message]
2017-03-14 12:43 ` [Outreachy kernel] [IIO] Help understanding iio_priv(..) Julia Lawall
2017-03-13 22:09   ` Aishwarya Pant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170313201511.GA12957@aishwarya \
    --to=aishpant@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.