linux-metag.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Hogan <james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
To: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] metag: Only define atomic_dec_if_positive conditionally
Date: Fri, 7 Oct 2016 21:31:54 +0100	[thread overview]
Message-ID: <20161007203154.GS19354@jhogan-linux.le.imgtec.org> (raw)
In-Reply-To: <1475862059-8707-1-git-send-email-linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1393 bytes --]

On Fri, Oct 07, 2016 at 10:40:59AM -0700, Guenter Roeck wrote:
> The definition of atomic_dec_if_positive() assumes that
> atomic_sub_if_positive() exists, which is only the case if
> metag specific atomics are used. This results in the following
> build error when trying to build metag1_defconfig.
> 
> kernel/ucount.c: In function 'dec_ucount':
> kernel/ucount.c:211: error:
> 	implicit declaration of function 'atomic_sub_if_positive'
> 
> Moving the definition of atomic_dec_if_positive() into the metag
> conditional code fixes the problem.
> 
> Signed-off-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
> ---
>  arch/metag/include/asm/atomic.h | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/metag/include/asm/atomic.h b/arch/metag/include/asm/atomic.h
> index 470e365f04ea..8ff0a70865f6 100644
> --- a/arch/metag/include/asm/atomic.h
> +++ b/arch/metag/include/asm/atomic.h
> @@ -39,11 +39,10 @@
>  #define atomic_dec(v) atomic_sub(1, (v))
>  
>  #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
> +#define atomic_dec_if_positive(v)       atomic_sub_if_positive(1, v)
>  
>  #endif
>  
> -#define atomic_dec_if_positive(v)       atomic_sub_if_positive(1, v)
> -
>  #include <asm-generic/atomic64.h>
>  
>  #endif /* __ASM_METAG_ATOMIC_H */

Applied, thanks Guenter!

Cheers
James


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      parent reply	other threads:[~2016-10-07 20:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-07 17:40 [PATCH] metag: Only define atomic_dec_if_positive conditionally Guenter Roeck
     [not found] ` <1475862059-8707-1-git-send-email-linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2016-10-07 20:31   ` James Hogan [this message]

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=20161007203154.GS19354@jhogan-linux.le.imgtec.org \
    --to=james.hogan-1axoqhu6uovqt0dzr+alfa@public.gmane.org \
    --cc=linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).