From: Jesper Juhl <jesper.juhl@gmail.com>
To: Harald Welte <laforge@gnumonks.org>
Cc: Linux Kernel Mailinglist <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] New: Omnikey CardMan 4040 PCMCIA Driver
Date: Sun, 4 Sep 2005 00:27:20 +0200 [thread overview]
Message-ID: <9a87484905090315273f9b7048@mail.gmail.com> (raw)
In-Reply-To: <20050904110800.GN4415@rama.de.gnumonks.org>
On 9/4/05, Harald Welte <laforge@gnumonks.org> wrote:
> On Sun, Sep 04, 2005 at 12:12:18PM +0200, Harald Welte wrote:
> > Hi!
> >
> > Below you can find a driver for the Omnikey CardMan 4040 PCMCIA
> > Smartcard Reader.
>
> Sorry, the patch was missing a "cg-add" of the header file. Please use
> the patch below.
It would be so much nicer if the patch actually was "below" - that is
"inline in the email as opposed to as an attachment". Having to first
save an attachment and then cut'n'paste from it is a pain.
Anyway, a few comments below :
+#define DEBUG(n, x, args...) do { if (pc_debug >= (n)) \
line longer than 80 chars. Please adhere to CodingStyle and keep lines
<80 chars.
There's more than one occourance of this.
+static inline int cmx_waitForBulkOutReady(reader_dev_t *dev)
Why TheStudlyCaps ? Please keep function names lowercase. There are
more instances of this, only pointing out one.
+ register int i;
+ register int iobase = dev->link.io.BasePort1;
Please use only tabs for indentation (line 1 of the above is indented
with spaces).
+ for (i=0; i < POLL_LOOP_COUNT; i++) {
for (i = 0; i < POLL_LOOP_COUNT; i++) {
+ if (rc != 1)
Again spaces used for indentation, please fix all that up to use tabs.
+ unsigned long ulBytesToRead;
lowercase prefered also for variables.
+ for (i=0; i<5; i++) {
for (i = 0; i < 5; i++) {
+ DEBUG(5,"cmx_waitForBulkInReady rc=%.2x\n",rc);
Space after ","s please : DEBUG(5, "cmx_waitForBulkInReady rc=%.2x\n", rc);
+ ulMin = (count < (ulBytesToRead+5))?count:(ulBytesToRead+5);
needs spaces :
ulMin = (count < (ulBytesToRead + 5)) ? count : (ulBytesToRead + 5);
+ reader_dev_t *dev=(reader_dev_t *)filp->private_data;
reader_dev_t *dev = (reader_dev_t *)filp->private_data;
+static int cmx_open (struct inode *inode, struct file *filp)
get rid of the space before the opening paren :
static int cmx_open(struct inode *inode, struct file *filp)
+ for (rc = pcmcia_get_first_tuple(handle, &tuple);
+ rc == CS_SUCCESS;
+ rc = pcmcia_get_next_tuple(handle, &tuple)) {
...
+ if (parse.cftable_entry.io.nwin) {
+ link->io.BasePort1 = parse.cftable_entry.io.win[0].base;
+ link->io.NumPorts1 = parse.cftable_entry.io.win[0].len;
+ link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
+ if(!(parse.cftable_entry.io.flags & CISTPL_IO_8BIT))
+ link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
...
+ }
+ }
How about not having to indent so deep by rewriting that as
for (rc = pcmcia_get_first_tuple(handle, &tuple);
rc == CS_SUCCESS;
rc = pcmcia_get_next_tuple(handle, &tuple)) {
...
if (!parse.cftable_entry.io.nwin)
continue;
link->io.BasePort1 = parse.cftable_entry.io.win[0].base;
link->io.NumPorts1 = parse.cftable_entry.io.win[0].len;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
if(!(parse.cftable_entry.io.flags & CISTPL_IO_8BIT))
link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
...
}
+ link->conf.IntType = 00000002;
more spaces used for indentation. Not going to point out any more of these.
+ cmx_poll_timer.function = &cmx_do_poll;
shouldn't this be
cmx_poll_timer.function = cmx_do_poll;
???
+ int i;
+ DEBUG(3, "-> reader_detach(link=%p\n", link);
please have a blank line between variable declarations and other statements.
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
next prev parent reply other threads:[~2005-09-03 22:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-04 10:12 [PATCH] New: Omnikey CardMan 4040 PCMCIA Driver Harald Welte
2005-09-03 21:27 ` Chase Venters
2005-09-03 22:13 ` Nish Aravamudan
2005-09-03 22:23 ` Chase Venters
2005-09-04 7:33 ` Harald Welte
2005-09-04 11:20 ` Harald Welte
2005-09-06 16:15 ` Roland Dreier
2005-09-06 17:11 ` Harald Welte
2005-09-03 21:56 ` Alexey Dobriyan
2005-09-04 7:10 ` Harald Welte
2005-09-04 11:08 ` Harald Welte
2005-09-03 22:27 ` Jesper Juhl [this message]
2005-09-04 21:06 ` Horst von Brand
2005-09-04 22:10 ` Jesper Juhl
2005-09-05 10:30 ` Harald Welte
2005-09-04 12:58 ` Ingo Oeser
2005-09-05 9:14 ` Harald Welte
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=9a87484905090315273f9b7048@mail.gmail.com \
--to=jesper.juhl@gmail.com \
--cc=laforge@gnumonks.org \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.