From patchwork Wed Feb 27 22:15:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 2194761 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id F0C3FDF2F2 for ; Wed, 27 Feb 2013 22:16:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752091Ab3B0WQA (ORCPT ); Wed, 27 Feb 2013 17:16:00 -0500 Received: from mout.gmx.net ([212.227.17.21]:53748 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750699Ab3B0WP7 (ORCPT ); Wed, 27 Feb 2013 17:15:59 -0500 Received: from mailout-de.gmx.net ([10.1.76.17]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0Lr5Xp-1Uo1r30Gx9-00eb9R for ; Wed, 27 Feb 2013 23:15:58 +0100 Received: (qmail invoked by alias); 27 Feb 2013 22:15:57 -0000 Received: from p54AD04DF.dip0.t-ipconnect.de (EHLO p100.box) [84.173.4.223] by mail.gmx.net (mp017) with SMTP; 27 Feb 2013 23:15:57 +0100 X-Authenticated: #1045983 X-Provags-ID: V01U2FsdGVkX1+wrC4f4Ouw9Ol65LqYYR6WGxW9yxmDIvrLR5riuS YJyuflI43aVaFp Date: Wed, 27 Feb 2013 23:15:52 +0100 From: Helge Deller To: linux-parisc@vger.kernel.org, James Bottomley Subject: parisc: fix compile warnings triggered by atomic_sub(sizeof(),v) Message-ID: <20130227221552.GA2817@p100.box> References: <20130227221137.GA2806@p100.box> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130227221137.GA2806@p100.box> User-Agent: Mutt/1.5.21 (2010-09-15) X-Y-GMX-Trusted: 0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org commit 4e5a5143e77add104aeee9cd6a92a2f89ab6edd6 Author: Helge Deller Date: Wed Feb 27 00:14:56 2013 +0100 parisc: fix compile warnings triggered by atomic_sub(sizeof(),v) This fixes compile warnings like this one: net/ipv4/igmp.c: In function ‘ip_mc_leave_group’: net/ipv4/igmp.c:1898:3: warning: overflow in implicit constant conversion [-Woverflow] atomic_sub() is defined as and if VAL is of type unsigned int (as returned by sizeof()), negating this value will overflow. Fix this by type-casting VAL to int type: Signed-off-by: Helge Deller --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h index af9cf30..f38e198 100644 --- a/arch/parisc/include/asm/atomic.h +++ b/arch/parisc/include/asm/atomic.h @@ -115,8 +115,8 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u) } -#define atomic_add(i,v) ((void)(__atomic_add_return( (i),(v)))) -#define atomic_sub(i,v) ((void)(__atomic_add_return(-(i),(v)))) +#define atomic_add(i,v) ((void)(__atomic_add_return( (i),(v)))) +#define atomic_sub(i,v) ((void)(__atomic_add_return(-((int) (i)),(v)))) #define atomic_inc(v) ((void)(__atomic_add_return( 1,(v)))) #define atomic_dec(v) ((void)(__atomic_add_return( -1,(v))))