From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Hogan Subject: Re: [PATCH] metag: Only define atomic_dec_if_positive conditionally Date: Fri, 7 Oct 2016 21:31:54 +0100 Message-ID: <20161007203154.GS19354@jhogan-linux.le.imgtec.org> References: <1475862059-8707-1-git-send-email-linux@roeck-us.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="+nLR7g8KNfrRqv5t" Return-path: Content-Disposition: inline In-Reply-To: <1475862059-8707-1-git-send-email-linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org> Sender: linux-metag-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: To: Guenter Roeck Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org --+nLR7g8KNfrRqv5t Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > kernel/ucount.c: In function 'dec_ucount': > kernel/ucount.c:211: error: > implicit declaration of function 'atomic_sub_if_positive' >=20 > Moving the definition of atomic_dec_if_positive() into the metag > conditional code fixes the problem. >=20 > Signed-off-by: Guenter Roeck > --- > arch/metag/include/asm/atomic.h | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/arch/metag/include/asm/atomic.h b/arch/metag/include/asm/ato= mic.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)) > =20 > #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) > +#define atomic_dec_if_positive(v) atomic_sub_if_positive(1, v) > =20 > #endif > =20 > -#define atomic_dec_if_positive(v) atomic_sub_if_positive(1, v) > - > #include > =20 > #endif /* __ASM_METAG_ATOMIC_H */ Applied, thanks Guenter! Cheers James --+nLR7g8KNfrRqv5t Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX+AY6AAoJEGwLaZPeOHZ6rPgP/3/NyU57DAszmgF7P9DQSGnZ Lq+v7E58PN2XCKTEvxfKqWpDLOxXgclUdFxmAPA1Pbe8+csU/F5N6DfPfnF9iZEH rzNVvui+yzALB/5BaHqueZJDtG3zGydFzGZGPWNAM2fcEy0Lye338PUSCbpuoVvL vnbVB7OLD3P8kOXyFfG24R3RSIxg6IahtuITVdLoMgMoSkvoGlaI51zectAZ9mzi Y5cJEK219qJN/xzNtgmUHHk15ZBwl+G5r5XHbOoHF5udFbw8EbujsQDw+rVqFCyW oKDu2eBI2tY7lYR8br8XYCtQZzWMB1dkiVJeFKheq7QMoOMNANQr46GMXw6f2Y9J EyIegtrFW4kx0vdAHTTxKGQj4t0u7IErvDGFu74xy5AvKqZUcVY842+cpGDWdJfW LNZXwKPgW0QWjX8j2knI1XcmKexN54h3vdA1RY1fefj+JcIK6DY9L638/nHzoxLl lnHIlpAwkkJEVR1PxQjYD5Wl7Kn1hwg8JkWfEc4bW6g9878uWvgkuPqVpnBL6aB8 3qfIXA51U0AwwQ9yYsqE2kBMrgYl13Pd8Uu/TEcemqJQd5JJi2UaMXV4RnMVXhvJ BeScRM2vahCkkZ8/zX3JOIoriyY5F9FOMQHbGWi2a7XjZM3kCqaZd4M1kKQ5ilsY kIWJ9B7oiaipFjvoRau9 =nn0V -----END PGP SIGNATURE----- --+nLR7g8KNfrRqv5t--