From: Christoph Hellwig <hch@infradead.org>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] Altix system controller event handling
Date: Wed, 09 Mar 2005 22:31:42 +0000 [thread overview]
Message-ID: <20050309223142.GB9395@infradead.org> (raw)
In-Reply-To: <Pine.SGI.4.58.0503090818080.99386@gallifrey.americas.sgi.com>
> + extern nasid_t master_nasid;
please put externs always in headers (that are included by the file
defining the blobal symbol, too)
> +#include "snsc.h"
> +#include <asm/sn/sn_sal.h>
> +#include <linux/interrupt.h>
> +#include <linux/sched.h>
header ordering is <linux/*.h> first, then <asm/*.h>, then local
headers.
> +scdrv_event_interrupt(int irq, void *subch_data, struct pt_regs *regs)
> +{
> + struct subch_data_s *sd = (struct subch_data_s *) subch_data;
no need to cast.
> +static unsigned int
> +scdrv_buffer_to_int(char *buf)
> +{
> + int i;
> + unsigned int n = 0;
> + for( i = 0; i < sizeof(n); i++ ) {
> + n |= ((unsigned)(*(unsigned char *)buf++)
> + << (8 * ((sizeof(n) - i) - 1)));
urgg. the (*(unsigned char *)buf++) should be just *(buf++), no?
address arithmetics on signed and unsigned char are the same.
So
for (i = 0; i < sizeof(n); i++)
n |= ((unsigned int)buf[i] << (8 * (sizeof(n) - i - 1)));
should do the same, no?
> + event_sd = (struct subch_data_s *) kmalloc
> + (sizeof (struct subch_data_s), GFP_KERNEL);
no need to cast
next prev parent reply other threads:[~2005-03-09 22:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-09 16:38 [PATCH] Altix system controller event handling Greg Howard
2005-03-09 22:31 ` Christoph Hellwig [this message]
2005-03-10 10:57 ` Andreas Schwab
2005-03-10 16:48 ` Greg Howard
2005-03-10 17:02 ` Andreas Schwab
2005-03-10 18:02 ` Greg Howard
2005-03-10 22:19 ` Christoph Hellwig
2005-03-10 22:55 ` Greg Howard
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=20050309223142.GB9395@infradead.org \
--to=hch@infradead.org \
--cc=linux-ia64@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