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] Patch for i2c-elektor driver
Date: Tue, 04 Oct 2005 23:39:00 +0000	[thread overview]
Message-ID: <20051004233813.4d207270.khali@linux-fr.org> (raw)
In-Reply-To: <eeae3ce2cd160ac835fcb05bb9a2d829@lizardlogic.co.uk>

Hi Stig,

One preliminary question: Did you attempt to contact Hans Berglund or
Oleg I. Vdovikin for their opinion on and testing of your patch?

> I have split the patch into two, annotated and signed off.  Patch 1 is 
> the bug fixes.  Patch 2 is a bit of code cleanup.  Some of patch 2 you 
> may think is not worth changing.  I have no problem with that.
> 
> On my system, the current elektor driver will oops on module load and 
> has no chance of working because the IO regions are not mapped.  Patch 
> 1 fixes it (for me).

Are you using mmapped=0 or 1? Wasn't it just a matter of using the
other? I guess there is a reason why this option exists.

I don't really feel qualified to review the first patch, as I have
relatively little idea how I/O mapping is supposed to work. Greg, want
to comment? All the (relatively) recent changes to the driver are
yours, although I'm not sure it actually means anything.

All I can offer myself are a few comments on the rest:

> +	pr_debug("i2c-elektor: Write %p 0x%02X\n", address, val & 255);

Can we get rid of that "& 255"? Looks pointless to me.

> +#if __alpha__
> +	/* API UP2000 needs some hardware fudging to make the write stick */
> +	iowrite8(val, address);
> +#endif

My understanding is that adding this here means that the following lines
later in the code:

>					/* I don't know why we need to
> 					   write twice */
>  					mmapped = 2;

could (and should) be removed. Right?

> +			printk(KERN_ERR "i2c-elektor: requested mem region (%#x:2) "
> +					"is in use.\n", base );

No dot at end of message please. Also a coding style problem, no space
before closing parenthesis.

> +		if( base_iomem = NULL ) {

Coding style.

> +			printk(KERN_ERR "i2c-elecktor: remap of memory region failed\n");

s/elecktor/elektor/

> +	pr_debug("registers %#x remapped to %p\n", base, base_iomem);

Please add an "i2c-elektor: " prefix as the other messages have.

As for the second patch, I'm globally happy with it, only a few minor
comments as well:

> -			       "i2c-elektor: requested I/O region (0x%X:2) "
> +			       "i2c-elektor: requested I/O region (%#x:2) "
>  			       "is in use.\n", base);

You could additionally drop the trailing dot.

> -					printk(KERN_INFO "i2c-elektor: found API UP2000 like board, will probe PCF8584 later.\n");
> +					printk(KERN_INFO
> +					       "i2c-elektor: found API UP2000 like board, will probe PCF8584 later.\n");

This is still too wide after your change. Please split the string, and
drop the training dot while you're there.

> -		printk(KERN_ERR "i2c-elektor: incorrect base address (0x%0X) specified for mmapped I/O.\n", base);
> +		printk(KERN_ERR "i2c-elektor: incorrect base address (%#x) specified for mmapped I/O.\n", base);

Likewise, please split into pieces so that it fits in 80 columns, and
drop the trailing dot.

Additional possible cleanup:

> 	printk(KERN_ERR "i2c-elektor: found device at %#x.\n", base);

This certainly isn't an error, and trailing dot can be dropped.

Care to respin the patches with the suggested changes? Then I'll push
them upwards.

Thanks for the good work,
-- 
Jean Delvare

  parent reply	other threads:[~2005-10-04 23:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-04 12:51 [lm-sensors] Patch for i2c-elektor driver Stig Telfer
2005-10-04 16:56 ` Jean Delvare
2005-10-04 21:23 ` Stig Telfer
2005-10-04 23:39 ` Jean Delvare [this message]
2005-10-04 23:46 ` Jean Delvare
2005-10-04 23:51 ` Greg KH
2005-10-06 12:46 ` Stig Telfer
2005-10-06 22:37 ` Jean Delvare
2005-10-07 15:30 ` Stig Telfer
2005-10-07 22:21 ` 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=20051004233813.4d207270.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.