From patchwork Fri May 16 21:07:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Gross X-Patchwork-Id: 349785 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id F03FC14008B for ; Sat, 17 May 2014 07:15:39 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756087AbaEPVPg (ORCPT ); Fri, 16 May 2014 17:15:36 -0400 Received: from na3sys009aog106.obsmtp.com ([74.125.149.77]:44595 "HELO na3sys009aog106.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1755420AbaEPVPe (ORCPT ); Fri, 16 May 2014 17:15:34 -0400 Received: from mail-pb0-f50.google.com ([209.85.160.50]) (using TLSv1) by na3sys009aob106.postini.com ([74.125.148.12]) with SMTP ID DSNKU3Z/9SDjUj7Alg9TQwLehPaTrwzS+V5Z@postini.com; Fri, 16 May 2014 14:15:34 PDT Received: by mail-pb0-f50.google.com with SMTP id ma3so3114799pbc.9 for ; Fri, 16 May 2014 14:15:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SNPYLQOJdOiDfbZ9mQBIYMXjvgDEIVm0xoaVbSIY1NQ=; b=A7epPu4I9gUraNvU8KCuRR/kFkTkQJ0t3YpF4h935+VTaJ/xRTdlLAOw/UzBriXZ8G op1Gs5y6pfMEP1UHEyfmu1UJKa02HOEFUaCqMLDFqVfMVTe42UDWHlQDRHMVoIPn5VJe JKUeaUMpaN7vVonPmy65sDwreefLmgnV1CKw7OjLS2zQjBaDBq6dsKyok1sG+PwZHZ9o dc99lpvhXUY48oYpJATOIrhPR8TaeGm4xnnscmalX3jRxNfocH09YO04/qwbAbW9GbRE qJEp94G+GmJTxPldzq69GjWOyryaqbm6i8MzzOOWgkTwjlgdeLiJcKV6hVprt5BGGQUZ tm9Q== X-Received: by 10.68.201.226 with SMTP id kd2mr23971228pbc.157.1400274467832; Fri, 16 May 2014 14:07:47 -0700 (PDT) X-Gm-Message-State: ALoCoQkZpXfk1oFAK85+4RW2fDef2tNvVR55O/Qu1AziXoj1gYpacwuwBAYCW1BwzA/kDulbpo7chCgLEE/MGMgSEcS2hof3AXzpz3NuUi0Fm96HOVNCtwN/YX6gmsfn0YGWT6U/W6/t X-Received: by 10.68.201.226 with SMTP id kd2mr23971219pbc.157.1400274467782; Fri, 16 May 2014 14:07:47 -0700 (PDT) Received: from ubuntu.localdomain (c-71-202-123-143.hsd1.ca.comcast.net. [71.202.123.143]) by mx.google.com with ESMTPSA id di3sm16226257pbc.11.2014.05.16.14.07.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 May 2014 14:07:47 -0700 (PDT) From: Jesse Gross To: David Miller Cc: netdev@vger.kernel.org, dev@openvswitch.org, Daniele Di Proietto Subject: [PATCH net-next 02/12] openvswitch: avoid warnings in vport_from_priv Date: Fri, 16 May 2014 14:07:29 -0700 Message-Id: <1400274459-56304-3-git-send-email-jesse@nicira.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400274459-56304-1-git-send-email-jesse@nicira.com> References: <1400274459-56304-1-git-send-email-jesse@nicira.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Daniele Di Proietto This change, firstly, avoids declaring the formal parameter const, since it is treated as non const. (to avoid -Wcast-qual) Secondly, it cast the pointer from void* to u8*, since it is used in arithmetic (to avoid -Wpointer-arith) Signed-off-by: Daniele Di Proietto Signed-off-by: Jesse Gross --- net/openvswitch/vport.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/openvswitch/vport.h b/net/openvswitch/vport.h index d7e50a1..3e12940 100644 --- a/net/openvswitch/vport.h +++ b/net/openvswitch/vport.h @@ -185,9 +185,9 @@ static inline void *vport_priv(const struct vport *vport) * the result of a hash table lookup. @priv must point to the start of the * private data area. */ -static inline struct vport *vport_from_priv(const void *priv) +static inline struct vport *vport_from_priv(void *priv) { - return (struct vport *)(priv - ALIGN(sizeof(struct vport), VPORT_ALIGN)); + return (struct vport *)((u8 *)priv - ALIGN(sizeof(struct vport), VPORT_ALIGN)); } void ovs_vport_receive(struct vport *, struct sk_buff *,