From: Dave Hansen <haveblue@us.ibm.com>
To: Matthew Dobson <colpatch@us.ibm.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
John Stultz <johnstul@us.ibm.com>,
"Martin J. Bligh" <mbligh@aracnet.com>,
Andrew Morton <akpm@zip.com.au>
Subject: Re: [patch] 16-way x440 breakage
Date: 12 Aug 2003 08:38:02 -0700 [thread overview]
Message-ID: <1060702681.32409.2148.camel@nighthawk> (raw)
In-Reply-To: <3F342CE9.50308@us.ibm.com>
On Fri, 2003-08-08 at 16:06, Matthew Dobson wrote:
> + if ((rth->num_scal_dev > MAX_NUMNODES) ||
> + (rth->num_rio_dev > MAX_NUMNODES * 2)){
> + printk("%s ERROR! MAX_NUMNODES incorrectly defined as %d!!!\n", __FUNCTION__, MAX_NUMNODES);
> + return 1;
> + }
Why don't you actually warn for the real condition? MAX_NUMNODES isn't
incorrect, it's just too low. Could you mention that it needs to be
raised, and maybe the value it should be raised to?
> ptr = (unsigned long)rth + 3;
> - for(i = 0; i < rth->num_scal_dev; i++)
> - sd[i] = (struct scal_detail *)(ptr + (scal_detail_size * i));
> + for(i = 0; i < rth->num_scal_dev; i++, ptr += scal_detail_size)
> + sd[i] = (struct scal_detail *)ptr;
> +
> + for(i = 0; i < rth->num_rio_dev; i++, ptr += rio_detail_size)
> + rd[i] = (struct rio_detail *)ptr;
All the casting here scares me. If you're doing this:
(struct scal_detail *)(ptr + (scal_detail_size * i)
and this:
ptr += scal_detail_size
just make it a struct scal_detail * and be done with it. If it walks
like a duck...
--
Dave Hansen
haveblue@us.ibm.com
prev parent reply other threads:[~2003-08-12 15:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-08 23:06 [patch] 16-way x440 breakage Matthew Dobson
2003-08-12 15:38 ` Dave Hansen [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=1060702681.32409.2148.camel@nighthawk \
--to=haveblue@us.ibm.com \
--cc=akpm@zip.com.au \
--cc=colpatch@us.ibm.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbligh@aracnet.com \
/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