alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Update iatomic.h functions definitions for mips
@ 2013-08-15  9:17 jiashuo.kang
  2013-08-19  2:18 ` Jiashuo Kang
  0 siblings, 1 reply; 3+ messages in thread
From: jiashuo.kang @ 2013-08-15  9:17 UTC (permalink / raw)
  To: alsa-devel

From: Kai Kang <jiashuo.kang at gmail.com>

Functions atomic_add(s) and atomic_sub(s) are defined with 'extern
__inline__' that may cause compile fails when cross compile for mips.
The error message looks like:

| pcm/.libs/libpcm.a(pcm_meter.o): In function `snd_pcm_meter_update_scope':
| .../alsa-lib-1.0.27.2/src/pcm/pcm_meter.c:139: undefined reference to `atomic_sub'

Replace the 'extern __inline__' with 'static __inline__' to fix this
issue.

Signed-off-by: Kai Kang <jiashuo.kang at gmail.com>
---
 include/iatomic.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/iatomic.h b/include/iatomic.h
index 5711fe8..2393297 100644
--- a/include/iatomic.h
+++ b/include/iatomic.h
@@ -720,7 +720,7 @@ typedef struct { volatile int counter; } atomic_t;
  * Atomically adds @i to @v.  Note that the guaranteed useful range
  * of an atomic_t is only 24 bits.
  */
-extern __inline__ void atomic_add(int i, atomic_t * v)
+static __inline__ void atomic_add(int i, atomic_t * v)
 {
 	unsigned long temp;
 
@@ -744,7 +744,7 @@ extern __inline__ void atomic_add(int i, atomic_t * v)
  * Atomically subtracts @i from @v.  Note that the guaranteed
  * useful range of an atomic_t is only 24 bits.
  */
-extern __inline__ void atomic_sub(int i, atomic_t * v)
+static __inline__ void atomic_sub(int i, atomic_t * v)
 {
 	unsigned long temp;
 
@@ -763,7 +763,7 @@ extern __inline__ void atomic_sub(int i, atomic_t * v)
 /*
  * Same as above, but return the result value
  */
-extern __inline__ int atomic_add_return(int i, atomic_t * v)
+static __inline__ int atomic_add_return(int i, atomic_t * v)
 {
 	unsigned long temp, result;
 
@@ -784,7 +784,7 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v)
 	return result;
 }
 
-extern __inline__ int atomic_sub_return(int i, atomic_t * v)
+static __inline__ int atomic_sub_return(int i, atomic_t * v)
 {
 	unsigned long temp, result;
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Update iatomic.h functions definitions for mips
  2013-08-15  9:17 [PATCH] Update iatomic.h functions definitions for mips jiashuo.kang
@ 2013-08-19  2:18 ` Jiashuo Kang
  2013-08-22  8:42   ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Jiashuo Kang @ 2013-08-19  2:18 UTC (permalink / raw)
  To: alsa-devel

On Thu, Aug 15, 2013 at 5:17 PM, <jiashuo.kang@gmail.com> wrote:

> From: Kai Kang <jiashuo.kang at gmail.com>
>
> Functions atomic_add(s) and atomic_sub(s) are defined with 'extern
> __inline__' that may cause compile fails when cross compile for mips.
> The error message looks like:
>
> | pcm/.libs/libpcm.a(pcm_meter.o): In function
> `snd_pcm_meter_update_scope':
> | .../alsa-lib-1.0.27.2/src/pcm/pcm_meter.c:139: undefined reference to
> `atomic_sub'
>
> Replace the 'extern __inline__' with 'static __inline__' to fix this
> issue.
>
> Signed-off-by: Kai Kang <jiashuo.kang at gmail.com>
> ---
>  include/iatomic.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/iatomic.h b/include/iatomic.h
> index 5711fe8..2393297 100644
> --- a/include/iatomic.h
> +++ b/include/iatomic.h
> @@ -720,7 +720,7 @@ typedef struct { volatile int counter; } atomic_t;
>   * Atomically adds @i to @v.  Note that the guaranteed useful range
>   * of an atomic_t is only 24 bits.
>   */
> -extern __inline__ void atomic_add(int i, atomic_t * v)
> +static __inline__ void atomic_add(int i, atomic_t * v)
>  {
>         unsigned long temp;
>
> @@ -744,7 +744,7 @@ extern __inline__ void atomic_add(int i, atomic_t * v)
>   * Atomically subtracts @i from @v.  Note that the guaranteed
>   * useful range of an atomic_t is only 24 bits.
>   */
> -extern __inline__ void atomic_sub(int i, atomic_t * v)
> +static __inline__ void atomic_sub(int i, atomic_t * v)
>  {
>         unsigned long temp;
>
> @@ -763,7 +763,7 @@ extern __inline__ void atomic_sub(int i, atomic_t * v)
>  /*
>   * Same as above, but return the result value
>   */
> -extern __inline__ int atomic_add_return(int i, atomic_t * v)
> +static __inline__ int atomic_add_return(int i, atomic_t * v)
>  {
>         unsigned long temp, result;
>
> @@ -784,7 +784,7 @@ extern __inline__ int atomic_add_return(int i,
> atomic_t * v)
>         return result;
>  }
>
> -extern __inline__ int atomic_sub_return(int i, atomic_t * v)
> +static __inline__ int atomic_sub_return(int i, atomic_t * v)
>  {
>         unsigned long temp, result;
>
> --
> 1.8.1.2
>
>
Any comment?

Thanks,
Kai

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Update iatomic.h functions definitions for mips
  2013-08-19  2:18 ` Jiashuo Kang
@ 2013-08-22  8:42   ` Takashi Iwai
  0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2013-08-22  8:42 UTC (permalink / raw)
  To: Jiashuo Kang; +Cc: alsa-devel

At Mon, 19 Aug 2013 10:18:17 +0800,
Jiashuo Kang wrote:
> 
> On Thu, Aug 15, 2013 at 5:17 PM, <jiashuo.kang@gmail.com> wrote:
> 
> > From: Kai Kang <jiashuo.kang at gmail.com>
> >
> > Functions atomic_add(s) and atomic_sub(s) are defined with 'extern
> > __inline__' that may cause compile fails when cross compile for mips.
> > The error message looks like:
> >
> > | pcm/.libs/libpcm.a(pcm_meter.o): In function
> > `snd_pcm_meter_update_scope':
> > | .../alsa-lib-1.0.27.2/src/pcm/pcm_meter.c:139: undefined reference to
> > `atomic_sub'
> >
> > Replace the 'extern __inline__' with 'static __inline__' to fix this
> > issue.
> >
> > Signed-off-by: Kai Kang <jiashuo.kang at gmail.com>
> > ---
> >  include/iatomic.h | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/include/iatomic.h b/include/iatomic.h
> > index 5711fe8..2393297 100644
> > --- a/include/iatomic.h
> > +++ b/include/iatomic.h
> > @@ -720,7 +720,7 @@ typedef struct { volatile int counter; } atomic_t;
> >   * Atomically adds @i to @v.  Note that the guaranteed useful range
> >   * of an atomic_t is only 24 bits.
> >   */
> > -extern __inline__ void atomic_add(int i, atomic_t * v)
> > +static __inline__ void atomic_add(int i, atomic_t * v)
> >  {
> >         unsigned long temp;
> >
> > @@ -744,7 +744,7 @@ extern __inline__ void atomic_add(int i, atomic_t * v)
> >   * Atomically subtracts @i from @v.  Note that the guaranteed
> >   * useful range of an atomic_t is only 24 bits.
> >   */
> > -extern __inline__ void atomic_sub(int i, atomic_t * v)
> > +static __inline__ void atomic_sub(int i, atomic_t * v)
> >  {
> >         unsigned long temp;
> >
> > @@ -763,7 +763,7 @@ extern __inline__ void atomic_sub(int i, atomic_t * v)
> >  /*
> >   * Same as above, but return the result value
> >   */
> > -extern __inline__ int atomic_add_return(int i, atomic_t * v)
> > +static __inline__ int atomic_add_return(int i, atomic_t * v)
> >  {
> >         unsigned long temp, result;
> >
> > @@ -784,7 +784,7 @@ extern __inline__ int atomic_add_return(int i,
> > atomic_t * v)
> >         return result;
> >  }
> >
> > -extern __inline__ int atomic_sub_return(int i, atomic_t * v)
> > +static __inline__ int atomic_sub_return(int i, atomic_t * v)
> >  {
> >         unsigned long temp, result;
> >
> > --
> > 1.8.1.2
> >
> >
> Any comment?

Applied now.  Thanks.


Takashi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-22  8:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-15  9:17 [PATCH] Update iatomic.h functions definitions for mips jiashuo.kang
2013-08-19  2:18 ` Jiashuo Kang
2013-08-22  8:42   ` Takashi Iwai

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).