linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Moore, Eric" <Eric.Moore@lsil.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 8/8]  fusion - mptctl -adding asyn event notification support
Date: Sat, 4 Feb 2006 11:23:31 +0000	[thread overview]
Message-ID: <20060204112331.GA28196@infradead.org> (raw)
In-Reply-To: <F331B95B72AFFB4B87467BE1C8E9CF5F24369C@NAMAIL2.ad.lsil.com>

On Thu, Feb 02, 2006 at 05:20:01PM -0700, Moore, Eric wrote:
> Adding aen support.

looks good, but it could use some codingstyle love:


+/*
+ * Event Handler function
+ */
+static int mptctl_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply);

no need for the forward prototype, the function isn't used before it's
defined.

+struct fasync_struct *async_queue=NULL;

no need to initialize this to NULL because it'll go into .bss and will
be initializes automatically.  Also this variable can be static.

 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/* ASYNC Event Notification Support */
+static int
+mptctl_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
+{
+	u8 event;
+
+	event = le32_to_cpu(pEvReply->Event) & 0xFF;
+
+	dctlprintk(("%s() called\n", __FUNCTION__));
+	if(async_queue == NULL)

	if (async_queue == NULL)

or even better

	if (!async_queue)

+		ioc->aen_event_read_flag=1;

and please always put spaces around the '='

+static int
+mptctl_fasync(int fd, struct file *filep, int mode)
+{
+	MPT_ADAPTER	*ioc;
+
+	list_for_each_entry(ioc, &ioc_list, list)
+		ioc->aen_event_read_flag=0;

doesn't this need some locking?


      reply	other threads:[~2006-02-04 11:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-03  0:20 [PATCH 8/8] fusion - mptctl -adding asyn event notification support Moore, Eric
2006-02-04 11:23 ` Christoph Hellwig [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=20060204112331.GA28196@infradead.org \
    --to=hch@infradead.org \
    --cc=Eric.Moore@lsil.com \
    --cc=linux-scsi@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).