From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Subject: [PATCH] metag: Only define atomic_dec_if_positive conditionally Date: Fri, 7 Oct 2016 10:40:59 -0700 Message-ID: <1475862059-8707-1-git-send-email-linux@roeck-us.net> Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Message-Id:Date:Subject:Cc:To:From; bh=U7L9M7PmWQVTYjE8fTfq2e9nWmLoM203yl5JwFpPmWs=; b=MpwwZhEypkT4nzClBQXGiD2+Q+ MBjouJooHBpvlMA/TbPMUBCIrNNbvtv8eDhgSvNThofbB4/K235ECfAIioJ3QMWvJhri7PXq7N4kz qM/aZwUixlJMOF/K9g26VibxJXXqqBuK1PbVAXE7ECQR8MdaQeJX7zNu1tgX1TNHl/9+Ym9tHT3ge 5SC9K6PMBLLe6d/ILfnj+RVglhAVddNqS7rUfFRKfxtgn6eHVjj9s5tzSR0+vSEGagf3mkyEkLxaA OKday+ISaKJbSZcHt5mGR12mgaIPq4oSpcTH6Qu/SuRWWhn0Ivcv45Djs6aDOL9F+sevOWybFYnVy q37bVN+A==; Sender: linux-metag-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: James Hogan Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Guenter Roeck 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 --- 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 #endif /* __ASM_METAG_ATOMIC_H */ -- 2.5.0