public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: Aurelien Jarno <aurelien-rXXEIb44qovR7s880joybQ@public.gmane.org>
Subject: i2c-tools: Discussion points about future library
Date: Wed, 4 Apr 2012 16:01:13 +0200	[thread overview]
Message-ID: <20120404160113.2295c636@endymion.delvare> (raw)

Hi all,

There are two points which may need to be discussed concerning the
upcoming library in i2c-tools [1] [2].

[1] http://www.lm-sensors.org/wiki/I2CTools_4_Plan
[2] http://marc.info/?l=linux-i2c&m=133182689203486&w=2

First point is the name of the library. My original intent was to name
it libi2c-dev, because the library is essentially a front-end to the
i2c-dev kernel driver, and also because this is what Debian named their
package currently containing the (i2c-tools flavor of)
<linux/i2c-dev.h>. However Aurélien Jarno suggested that libi2c would
be just as fine, and easier/shorter. I am mostly convinced by now. I am
curious if anyone wants to express an opinion on the matter?

Second point is the creation of a header file to ease the migration of
tools from the old model (i2c-tools flavor of <linux/i2c-dev.h>) to the
new model (library with its header files + unchanged kernel headers).
Right now, the migration path looks like this:

+#include <sys/ioctl.h>
+#include <i2c/smbus.h>
 #include <linux/i2c-dev.h>

for SMBus tools, and this:

+#include <sys/ioctl.h>
+#include <linux/i2c.h>
 #include <linux/i2c-dev.h>
 
for I2C tools. I am happy with this, but Aurélien insisted that it
would be more friendly if tools only needed to include one header file
in order to make use of the library. For this we would need to create
an extra header file only including the other header files. Something
like <i2c/i2c.h> containing:

#include <sys/ioctl.h>
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
#include <i2c/smbus.h>

This would have the downside that tools end up (indirectly) including
header files they don't necessarily need. And migrating every tool is
still needed, as you would then still have to do:

-#include <linux/i2c-dev.h>
+#include <i2c/i2c.h>

I admit this is slightly easier than my initial plan, but the benefit
doesn't strike me as fundamental. Here again I would appreciate if
users of the i2c-dev driver could comment on this. I know that
libsensors (the only library I am intimately familiar with) does not
provide such an extra header file, but that's only one example so it
might not be relevant.

Thanks,
-- 
Jean Delvare

             reply	other threads:[~2012-04-04 14:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04 14:01 Jean Delvare [this message]
     [not found] ` <20120404160113.2295c636-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-04-04 17:41   ` i2c-tools: Discussion points about future library Mark Brown
     [not found]     ` <20120404174158.GA19773-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2012-04-04 19:23       ` Jean Delvare
     [not found]         ` <20120404212323.59053a1f-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-04-04 19:41           ` Martin Mokrejs
     [not found]             ` <4F7CA3D4.8000104-08dBlVkRsZWoiTQjSSYKZesEoJ4y9sgM@public.gmane.org>
2012-04-04 19:42               ` Martin Mokrejs
2012-04-05  7:49               ` Jean Delvare
     [not found]                 ` <20120405094910.1dcc4779-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-04-05  8:04                   ` Wolfram Sang
2012-04-05  9:42                   ` Martin Mokrejs
     [not found]                     ` <4F7D68F2.4040106-08dBlVkRsZWoiTQjSSYKZesEoJ4y9sgM@public.gmane.org>
2012-04-05 11:50                       ` Jean Delvare

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=20120404160113.2295c636@endymion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=aurelien-rXXEIb44qovR7s880joybQ@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.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