All of lore.kernel.org
 help / color / mirror / Atom feed
From: khali@linux-fr.org (Jean Delvare)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] Re: [PATCH 2.6] cleanup of i2c-nforce2
Date: Sun, 24 Jul 2005 16:28:27 +0000	[thread overview]
Message-ID: <20050724162811.587f11f1.khali@linux-fr.org> (raw)
In-Reply-To: <42E24733.7010207@gmx.net>

Hallo Hans-Frieder,

> attached is a small patch that removes unused code from i2c-nforce2
> and adds a single debug message. The patch is against 2.6.13-rc3-mm1.
> I have tested the patch with 2.6.13-rc3: compiles cleanly and works
> as without the patch (as expected).

Thanks for this cleanup patch, I like it. However, I would have a few
comments as I think we could clean up this driver even more.

1* The MAX_TIMEOUT constant doesn't seem to be used anywhere anymore, so
you could rip it.

2* There are a few more lines of code that are commented out:

265		/* case I2C_SMBUS_PROC_CALL: not supported */

270		/* case I2C_SMBUS_BLOCK_PROC_CALL: not supported */

288	    I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA /* |
289	    I2C_FUNC_SMBUS_BLOCK_DATA */;

Maybe you can rip them away as well (but see point 4*.)

3* This comment should be updated:

126 /* Return -1 on error. See smbus.h for more information */

There is no file named smbus.h.

4* The driver isn't very clear about what SMBus transactions it
supports. nforce2_func reports that only quick, byte, byte data and word
data transfers are supported, but nforce2_access seems to implement
block and i2c block transfers. If the block implementations work, they
should be advertised by nforce2_func. If not, they should be removed.

5* In nforce2_access, you have several cases for dealing with the
various transfer types that the driver doesn't support. As users should
check for advertised functionalities before they call nforce2_access, I
wouldn't bother detailing the errors with different error messages. The
default case should be enough.

May we have a similar patch for the Linux 2.4 version of the driver as
found in the lm_sensors CVS repository?

Thanks,
-- 
Jean Delvare

      reply	other threads:[~2005-07-24 16:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-23 15:34 [lm-sensors] [PATCH 2.6] cleanup of i2c-nforce2 Hans-Frieder Vogt
2005-07-24 16:28 ` 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=20050724162811.587f11f1.khali@linux-fr.org \
    --to=khali@linux-fr.org \
    --cc=lm-sensors@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 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.