All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corey Minyard <tcminyard@gmail.com>
To: linux-kernel@vger.kernel.org, linux-cris-kernel@axis.com,
	starvik@axis.com, jesper.nilsson@axis.com
Cc: Corey Minyard <cminyard@mvista.com>
Subject: Re: [PATCH] CRIS: Fix I/O macros
Date: Sat, 04 Aug 2012 12:25:48 -0500	[thread overview]
Message-ID: <501D5B1C.2070600@acm.org> (raw)
In-Reply-To: <1341865359-18482-1-git-send-email-minyard@acm.org>

Can we get something like this in?  It would fix a lot of build regressions.

-corey

On 07/09/2012 03:22 PM, minyard@acm.org wrote:
> From: Corey Minyard <cminyard@mvista.com>
>
> The inb/outb macros for CRIS are broken from a number of points of
> view, missing () around parameters and they have an unprotected if
> statement in them.  This was breaking the compile of IPMI on CRIS
> and thus I was being annoyed by build regressions, so I fixed them.
>
> Plus I don't think they would have worked at all, since the data
> values were missing "&" and the outsl had a "3" instead of a "4"
> for the size.  From what I can tell, this stuff is not used at all,
> so this can't be any more broken than it was before, anyway.
>
> Signed-off-by: Corey Minyard <cminyard@mvista.com>
> ---
>   arch/cris/include/asm/io.h |   39 +++++++++++++++++++++++++++++++++------
>   1 files changed, 33 insertions(+), 6 deletions(-)
>
> diff --git a/arch/cris/include/asm/io.h b/arch/cris/include/asm/io.h
> index 32567bc..ac12ae2 100644
> --- a/arch/cris/include/asm/io.h
> +++ b/arch/cris/include/asm/io.h
> @@ -133,12 +133,39 @@ static inline void writel(unsigned int b, volatile void __iomem *addr)
>   #define insb(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,1,count) : 0)
>   #define insw(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,2,count) : 0)
>   #define insl(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,4,count) : 0)
> -#define outb(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,1,1)
> -#define outw(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,2,1)
> -#define outl(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,4,1)
> -#define outsb(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,1,count)
> -#define outsw(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,2,count)
> -#define outsl(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,3,count)
> +static inline void outb(unsigned char data, unsigned int port)
> +{
> +	if (cris_iops)
> +		cris_iops->write_io(port, (void *) &data, 1, 1);
> +}
> +static inline void outw(unsigned short data, unsigned int port)
> +{
> +	if (cris_iops)
> +		cris_iops->write_io(port, (void *) &data, 2, 1);
> +}
> +static inline void outl(unsigned int data, unsigned int port)
> +{
> +	if (cris_iops)
> +		cris_iops->write_io(port, (void *) &data, 4, 1);
> +}
> +static inline void outsb(unsigned int port, const void *addr,
> +			 unsigned long count)
> +{
> +	if (cris_iops)
> +		cris_iops->write_io(port, (void *)addr, 1, count);
> +}
> +static inline void outsw(unsigned int port, const void *addr,
> +			 unsigned long count)
> +{
> +	if (cris_iops)
> +		cris_iops->write_io(port, (void *)addr, 2, count);
> +}
> +static inline void outsl(unsigned int port, const void *addr,
> +			 unsigned long count)
> +{
> +	if (cris_iops)
> +		cris_iops->write_io(port, (void *)addr, 4, count);
> +}
>   
>   /*
>    * Convert a physical pointer to a virtual kernel pointer for /dev/mem


  reply	other threads:[~2012-08-04 17:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09 20:22 [PATCH] CRIS: Fix I/O macros minyard
2012-08-04 17:25 ` Corey Minyard [this message]
2012-08-04 19:13   ` Geert Uytterhoeven

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=501D5B1C.2070600@acm.org \
    --to=tcminyard@gmail.com \
    --cc=cminyard@mvista.com \
    --cc=jesper.nilsson@axis.com \
    --cc=linux-cris-kernel@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minyard@acm.org \
    --cc=starvik@axis.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 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.