From patchwork Sat Sep 21 11:06:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 2922181 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 624F79F23C for ; Sat, 21 Sep 2013 11:08:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60FEF204F6 for ; Sat, 21 Sep 2013 11:08:54 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC7E2204EB for ; Sat, 21 Sep 2013 11:08:52 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VNL3H-0005Tr-DB; Sat, 21 Sep 2013 11:08:39 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VNL3E-0005oj-Vd; Sat, 21 Sep 2013 11:08:37 +0000 Received: from intranet.asianux.com ([58.214.24.6]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VNL3A-0005nb-IB for linux-arm-kernel@lists.infradead.org; Sat, 21 Sep 2013 11:08:34 +0000 Received: by intranet.asianux.com (Postfix, from userid 103) id 977D318402D0; Sat, 21 Sep 2013 19:07:48 +0800 (CST) X-Spam-Score: -101.9 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from [192.168.1.101] (unknown [118.26.255.71]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by intranet.asianux.com (Postfix) with ESMTP id 302C81840251; Sat, 21 Sep 2013 19:07:48 +0800 (CST) Message-ID: <523D7DC7.8030603@asianux.com> Date: Sat, 21 Sep 2013 19:06:47 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Russell King - ARM Linux , Catalin Marinas , Will Deacon Subject: [PATCH] ARM: include: asm: atomic.h: use type cast 's64' for the return value of atomic64_add_return(). X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130921_070833_006285_7C723504 X-CRM114-Status: GOOD ( 13.30 ) X-Spam-Score: -2.6 (--) Cc: "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The return value of atomic64_add_return() is u64 which never less than zero, so need type cast 's64' for comparing in atomic64_add_negative(). The related error: (allmodconfig for S5PV210, with "EXTRA_CFLAGS=-W"): kernel/events/core.c:5404:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] Signed-off-by: Chen Gang --- arch/arm/include/asm/atomic.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h index da1c77d..8cf005d 100644 --- a/arch/arm/include/asm/atomic.h +++ b/arch/arm/include/asm/atomic.h @@ -475,7 +475,7 @@ static inline int atomic64_add_unless(atomic64_t *v, u64 a, u64 u) return ret; } -#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0) +#define atomic64_add_negative(a, v) ((s64)atomic64_add_return((a), (v)) < 0) #define atomic64_inc(v) atomic64_add(1LL, (v)) #define atomic64_inc_return(v) atomic64_add_return(1LL, (v)) #define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0)