mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	devel@driverdev.osuosl.org, fmhess@users.sourceforge.net,
	abbotti@mev.co.uk, gregkh@linuxfoundation.org
Subject: Re: [PATCH 04/19] staging: comedi: adl_pci6208: document the register map of the device
Date: Thu, 28 Jun 2012 22:06:02 +0300	[thread overview]
Message-ID: <20120628190602.GM5333@mwanda> (raw)
In-Reply-To: <201206271456.44218.hartleys@visionengravers.com>

On Wed, Jun 27, 2012 at 02:56:43PM -0700, H Hartley Sweeten wrote:
> Add defines for the register map of the device. These will be
> used to clarify the code.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: Ian Abbott <abbotti@mev.co.uk>
> Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/staging/comedi/drivers/adl_pci6208.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/staging/comedi/drivers/adl_pci6208.c b/drivers/staging/comedi/drivers/adl_pci6208.c
> index f949d20..b6a8439 100644
> --- a/drivers/staging/comedi/drivers/adl_pci6208.c
> +++ b/drivers/staging/comedi/drivers/adl_pci6208.c
> @@ -53,6 +53,18 @@ References:
>   */
>  #include "../comedidev.h"
>  
> +/*
> + * PCI-6208/6216-GL register map
> + */
> +#define PCI6208_AO_CONTROL(x)		(0x00 + (2 * (x)))
> +#define PCI6208_AO_STATUS		0x00
> +#define PCI6208_AO_STATUS_DATA_SEND	(1 << 0)
> +#define PCI6208_DIO			0x40
> +#define PCI6208_DIO_DO_MASK		(0x0f)
> +#define PCI6208_DIO_DO_SHIFT		(0)
> +#define PCI6208_DIO_DI_MASK		(0xf0)
> +#define PCI6208_DIO_DI_SHIFT		(4)

This series is nice and I'm not nacking anything, but really is it
that useful to say:
	status = inw(dev->iobase + PCI6208_AO_STATUS);
instead of just?:
	status = inw(dev->iobase);

I'm not sure what the 0x00 in PCI6208_AO_CONTROL represents.  Some
of these are not used like PCI6208_DIO_DI_SHIFT.

Does checkpatch.pl complain if you leave off these parenthesis?  If
so I will complain again to the checkpatch.pl people.  Extra
parenthesis are silly and there not used consistently.  Only
PCI6208_AO_CONTROL() and PCI6208_AO_STATUS_DATA_SEND() need
paranthesis.

Again, I'm fine with this patch and the whole series.  These are
just comments.

regards,
dan carpenter


  reply	other threads:[~2012-06-28 19:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-27 21:56 H Hartley Sweeten
2012-06-28 19:06 ` Dan Carpenter [this message]
2012-06-28 19:56   ` Joe Perches
2012-06-28 19:57   ` H Hartley Sweeten

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=20120628190602.GM5333@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=abbotti@mev.co.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=fmhess@users.sourceforge.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hartleys@visionengravers.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome