Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Cut down on number of attribute macros?
Date: Fri, 26 Mar 2010 16:11:51 +0000	[thread overview]
Message-ID: <4BACDCC7.90508@cam.ac.uk> (raw)

Dear All,

As part of the abi changes, we would need a huge number of macros similar
to those currently provided in accel.h, adc.h and friends.

Often these actually lead to longer code that one would have if one called
the underlying IIO_DEVICE_ATTR and similar macros.  

Hence I'm after opinions from those working with the subsystem.  Are these
useful or would we be better served taking the approach of enforcing these
naming conventions via review of submitted drivers (similar to hwmon)?

Thus we rely on abi documentation rather than the current complex mess of
macros.

What do people think?

I'm certainly not inclined to enforce the use of these macros, particularly in
cases like the one I would have added as part of the new abi changes..

IIO_DEV_ATTR_ACCEL_Z_MAG_EITHER_RISING_VALUE(_mode, _show, _store, _reg)

vs just using IIO_DEVICE_ATTR directly in the instansiation

IIO_DEVICE_ATTR(accel_z_mag_either_rising_value,
	S_IRUGO | S_IWUSR,
	sca3000_show_thresh,
	sca3000_write_thresh,
	SCA3000_REG_CTRL_SEL_MD_Z_TH);

If anything the events, particularly the shared cases are even worse.

At some point I'm going to end up with an 80 character macro name using
the current approach.

Jonathan

                 reply	other threads:[~2010-03-26 16:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4BACDCC7.90508@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --cc=linux-iio@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox