mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rdunlap@xenotime.net>
To: mgross@linux.intel.com
Cc: arjan@infradead.org, linux-kernel@vger.kernel.org, mark.gross@intel.com
Subject: Re: [PATCH] riport LADAR driver
Date: Thu, 22 Jun 2006 22:52:39 -0700	[thread overview]
Message-ID: <20060622225239.bf0ccab2.rdunlap@xenotime.net> (raw)
In-Reply-To: <20060622231604.GA5208@linux.intel.com>

On Thu, 22 Jun 2006 16:16:04 -0700 mark gross wrote:

a.  still has 6 lines of trailing whitespace.

> diff -urN -X linux-2.6.17.1/Documentation/dontdiff ../linux-2.6.17.1/drivers/char/riport.c linux-2.6.17.1/drivers/char/riport.c
> --- ../linux-2.6.17.1/drivers/char/riport.c	1969-12-31 16:00:00.000000000 -0800
> +++ linux-2.6.17.1/drivers/char/riport.c	2006-06-22 16:07:34.000000000 -0700

> +static struct devriport __init *devriport_init(int major, int minor, unsigned int io, int irq,
> +				   int dma, int size, int *presult)
> +{
> +	struct devriport *this;
> +
> +	*presult = 0;
> +	this = kzalloc(sizeof(struct devriport), GFP_KERNEL);
> +	if (!this) {
> +		*presult = -ENOMEM;
> +		goto fail_memory;
> +	}
> +
> +	if (!request_region(io, 3, "riport")) {
> +		PDEBUG("request_region 0x%X of 3 bytes fails\n", io);
> +		*presult = -EBUSY;
> +		goto fail_io;
> +	}
> +	if (!request_region(io + ECP_OFFSET, 3, "riport")) {
> +		release_region(io,3);
> +
> +		PDEBUG("request_region 0x%X of 3 bytes fails\n", io + ECP_OFFSET );
> +		*presult = -EBUSY;
> +		goto fail_io;
> +	}

> +	this->pinode = NULL;
> +	this->pfile = NULL;
> +	this->usage = 0;
> +	this->syncWord = 0;
> +	this->bytestoread = 0;
> +	this->numbytesthisstate = 0;
> +	this->irqinuse = 0;

Since kzalloc() is now being used, above lines aren't needed.

> +		switch (this->readstate) {
> +			/* due to the magic of the ECP port, it seems that we are
> +			 guaranteed to be fed a header from the riegl whenever we call
> +			 riport_open.  this code assumes that is true */

For multi-line comments (multiple places), regular kernel
coding style is:
			/*
			 * due to blah blah ...
			 * end
			 */

> +static int devriport_open(struct devriport *this)
> +{

> +	result =
> +		request_irq(this->irq, devriport_irq_wrap, SA_INTERRUPT,
> +			"riport", this);

Put that on 2 lines.

> +static int __init riport_init(void)
> +{

> +	pdev =
> +	    devriport_init(riport.major, riport.numdevs, io, irq, dma, size,
> +			   &result);

Put on 2 lines.

> +}
> +

> +module_param(io, int, 0444);
> +MODULE_PARM_DESC(io, "if non-zero then overrides IO port address");
> +
> +module_param(irq, int, 0444);
> +MODULE_PARM_DESC(io, "if non-zero then overrides IRQ number");
                    irq

> +
> +module_param(size, int, 0444);
> +MODULE_PARM_DESC(io, "if non-zero then overrides buffer size");
                    size

---
~Randy

  parent reply	other threads:[~2006-06-23  5:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-22 14:41 mark gross
2006-06-22 17:46 ` Randy.Dunlap
2006-06-22 18:20 ` Arjan van de Ven
2006-06-22 23:16   ` mark gross
2006-06-22 23:21     ` Randy.Dunlap
2006-06-23  5:52     ` Randy.Dunlap [this message]
2006-06-23 22:46       ` mark gross
2006-06-24 11:00         ` Arjan van de Ven
2006-06-26 20:55           ` mark gross
2006-06-26 20:51             ` Arjan van de Ven
2006-06-26 21:18               ` mark gross
2006-06-24 22:33         ` Randy.Dunlap
2006-06-24 12:48 Gross, Mark
2006-06-24 23:25 Gross, Mark

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=20060622225239.bf0ccab2.rdunlap@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.gross@intel.com \
    --cc=mgross@linux.intel.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

all inboxes | Powered by JetHome®