mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: "Jon Smirl" <jonsmirl@gmail.com>
Cc: lkml <linux-kernel@vger.kernel.org>, i2c@lm-sensors.org
Subject: Re: [i2c] [PATCH] Fix i2c module parameter permissions for read/write
Date: Tue, 6 Nov 2007 17:51:14 +0100	[thread overview]
Message-ID: <20071106175114.62284a6c@hyperion.delvare> (raw)
In-Reply-To: <9e4733910711040539h5714faeeq6a9985fa5a63963@mail.gmail.com>

Hi Jon,

On Sun, 4 Nov 2007 08:39:49 -0500, Jon Smirl wrote:
> I figured out later by inserting printks into the driver that they
> were being set from the command line, but without changing the
> permissions there was no way to read them to verify.  The permissions
> should at least be set to 0444 to allow them to be read.

There's nothing to "verify" - the code works as intended, that's about
it.

> IMHO the I2C_CLIENT_INSMOD macros could use some rework since they use
> side effects to set variables without being explicit about it.

I don't understand what you mean here. Can you please be more specific?

> The real problem was unrelated to this, it was an off by one error in
> the i2c bus numbering code of my embedded processor. That made the
> parameters not work since I was setting them on a different bus.
> 
> Changed to 0444.

I'd rather not do that. The i2c core uses I2C_CLIENT_MODULE_PARM()
extensively and I don't really want to create dozens of additional
sysfs files for no good reason. If you want your own parameter to be
readable (or even writable if it makes sense - you didn't show the
code) I'd rather suggest adding a parameter to I2C_CLIENT_MODULE_PARM()
to let the caller decide what mode the attribute should have, setting
the mode to 0 for all the core parameters.

That being said, this whole set of macros in i2c.h is a complete mess
and with David Brownell's work on the i2c-core, using them should
become less necessary over time. Ultimately I'd be happy to get rid of
them completely.

Thanks,
-- 
Jean Delvare

      reply	other threads:[~2007-11-06 16:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-04  4:55 Jon Smirl
2007-11-04  9:55 ` [i2c] " Jean Delvare
2007-11-04 13:39   ` Jon Smirl
2007-11-06 16:51     ` Jean Delvare [this message]

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=20071106175114.62284a6c@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=i2c@lm-sensors.org \
    --cc=jonsmirl@gmail.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®