netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Oeser <netdev@axxeo.de>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: netdev@vger.kernel.org, jgarzik@pobox.com, domen.puncer@telargo.com
Subject: Re: [PATCH 2/2] [POWERPC] Fix region size check in mpc5200 FEC driver
Date: Thu, 1 Nov 2007 19:13:55 +0100	[thread overview]
Message-ID: <200711011913.55525.netdev@axxeo.de> (raw)
In-Reply-To: <20071101142235.7620.36853.stgit@trillian.cg.shawcable.net>

Hi Grant,

Grant Likely schrieb:
> From: Grant Likely <grant.likely@secretlab.ca>
> 
> Driver shouldn't complain if the register range is larger than what
> it expects.  This works around failures with some device trees.
> 

But maybe the firmware guys like to know about it?
May I suggest putting this in front of the other check?

if ((mem.end - mem.start + 1) > sizeof(struct mpc52xx_fec)) {
  		printk(KERN_DEBUG DRIVER_NAME
			" - gratious resource size (%lx > %x), check mpc52xx_devices.c\n",
  			(unsigned long)(mem.end - mem.start + 1), sizeof(struct mpc52xx_fec));
}

> -	if ((mem.end - mem.start + 1) != sizeof(struct mpc52xx_fec)) {
> +	if ((mem.end - mem.start + 1) < sizeof(struct mpc52xx_fec)) {
>  		printk(KERN_ERR DRIVER_NAME
> -			" - invalid resource size (%lx != %x), check mpc52xx_devices.c\n",
> +			" - invalid resource size (%lx < %x), check mpc52xx_devices.c\n",
>  			(unsigned long)(mem.end - mem.start + 1), sizeof(struct mpc52xx_fec));
>  		return -EINVAL;
>  	}


Best Regards

Ingo Oeser

  reply	other threads:[~2007-11-01 18:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-01 14:22 [PATCH 0/2] Fixes to MPC5200 FEC driver Grant Likely
2007-11-01 14:22 ` [PATCH 1/2] [POWERPC] mpc5200: Fix Kconfig dependancies on MPC5200 FEC device driver Grant Likely
2007-11-01 14:22 ` [PATCH 2/2] [POWERPC] Fix region size check in mpc5200 FEC driver Grant Likely
2007-11-01 18:13   ` Ingo Oeser [this message]
2007-11-01 18:25     ` Grant Likely

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=200711011913.55525.netdev@axxeo.de \
    --to=netdev@axxeo.de \
    --cc=domen.puncer@telargo.com \
    --cc=grant.likely@secretlab.ca \
    --cc=jgarzik@pobox.com \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).