From patchwork Thu Mar 27 15:28:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 27228 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A752A202FA for ; Thu, 27 Mar 2014 16:11:09 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wn1sf13292706obc.1 for ; Thu, 27 Mar 2014 09:11:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=J69wFDuftn3WarcjvCl3WdRto7CuK9J2RIJNnBhC8AM=; b=ftjxi9XkNXZnWE14S0EvpLPs6xvBF5MUJ2VXTFuX/Rp4NouE1A290z7D5WC7LOb0pg UfrkhUQvEBXN7ybs03KFXH2KcAJmayWU3bpG+vYTDAHjdarAt6WWC89li6hyKnik7waW x+3Z7NFJ1Q2HM485uuhYOrCwuOjhsmGO+yeLZ2ojwAPi4x2+t04dylyCP0jWr/3wOdxC 8ePE9AUsSolniLcvVlUei6Ozd21RfBdHSkC3vMbiwKhFxNh0gGUJnb+69HfmVynvG7Pj /l0vPOdCBTU7+eSL5IUlpHUNlUigDt/J+uCYDhcS+XRT1GVeoifQ7NBkFQc9CWDGCf/Q 54Gg== X-Gm-Message-State: ALoCoQngx8IdefkWYuzZ7keF+YQ/9Is8CZPmttN9e2wu90Rjhjai4492cpheCn8ivWoEjXEi3W0w X-Received: by 10.182.66.137 with SMTP id f9mr1047754obt.3.1395936668993; Thu, 27 Mar 2014 09:11:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.43.134 with SMTP id e6ls1030530qga.17.gmail; Thu, 27 Mar 2014 09:11:08 -0700 (PDT) X-Received: by 10.52.171.68 with SMTP id as4mr1831379vdc.0.1395936668903; Thu, 27 Mar 2014 09:11:08 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id 7si543515vcm.206.2014.03.27.09.11.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Mar 2014 09:11:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so4486262veb.0 for ; Thu, 27 Mar 2014 09:11:08 -0700 (PDT) X-Received: by 10.52.37.196 with SMTP id a4mr1803925vdk.33.1395936668821; Thu, 27 Mar 2014 09:11:08 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp40568vck; Thu, 27 Mar 2014 09:11:08 -0700 (PDT) X-Received: by 10.224.74.201 with SMTP id v9mr3198777qaj.94.1395936667644; Thu, 27 Mar 2014 09:11:07 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k1si1254429qaf.5.2014.03.27.09.11.07 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 27 Mar 2014 09:11:07 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:54718 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCtX-0001Dv-5W for patch@linaro.org; Thu, 27 Mar 2014 12:11:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCqi-0005lS-Ov for qemu-devel@nongnu.org; Thu, 27 Mar 2014 12:08:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTCqZ-0000up-Ux for qemu-devel@nongnu.org; Thu, 27 Mar 2014 12:08:12 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:57448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTCqZ-0000uM-Mg; Thu, 27 Mar 2014 12:08:03 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id A833843733; Thu, 27 Mar 2014 20:08:02 +0400 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 640C867B; Thu, 27 Mar 2014 19:28:31 +0400 (MSK) Received: (nullmailer pid 1797 invoked by uid 1000); Thu, 27 Mar 2014 15:28:30 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Thu, 27 Mar 2014 19:28:20 +0400 Message-Id: <1395934108-1694-16-git-send-email-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395934108-1694-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1395934108-1694-1-git-send-email-mjt@msgid.tls.msk.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 86.62.121.231 Cc: qemu-trivial@nongnu.org, Peter Maydell , Michael Tokarev Subject: [Qemu-devel] [PULL 15/23] hw/usb/hcd-ohci.c: Avoid shifting left into sign bit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mjt@tls.msk.ru X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Peter Maydell Add U suffix to avoid undefined behaviour. This is only strictly necessary for the 1<<31 cases, but we add it for the other constants in these groups for consistency. Signed-off-by: Peter Maydell Signed-off-by: Michael Tokarev --- hw/usb/hcd-ohci.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 3d35058..93f186f 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -234,15 +234,15 @@ struct ohci_iso_td { #define OHCI_STATUS_OCR (1<<3) #define OHCI_STATUS_SOC ((1<<6)|(1<<7)) -#define OHCI_INTR_SO (1<<0) /* Scheduling overrun */ -#define OHCI_INTR_WD (1<<1) /* HcDoneHead writeback */ -#define OHCI_INTR_SF (1<<2) /* Start of frame */ -#define OHCI_INTR_RD (1<<3) /* Resume detect */ -#define OHCI_INTR_UE (1<<4) /* Unrecoverable error */ -#define OHCI_INTR_FNO (1<<5) /* Frame number overflow */ -#define OHCI_INTR_RHSC (1<<6) /* Root hub status change */ -#define OHCI_INTR_OC (1<<30) /* Ownership change */ -#define OHCI_INTR_MIE (1<<31) /* Master Interrupt Enable */ +#define OHCI_INTR_SO (1U<<0) /* Scheduling overrun */ +#define OHCI_INTR_WD (1U<<1) /* HcDoneHead writeback */ +#define OHCI_INTR_SF (1U<<2) /* Start of frame */ +#define OHCI_INTR_RD (1U<<3) /* Resume detect */ +#define OHCI_INTR_UE (1U<<4) /* Unrecoverable error */ +#define OHCI_INTR_FNO (1U<<5) /* Frame number overflow */ +#define OHCI_INTR_RHSC (1U<<6) /* Root hub status change */ +#define OHCI_INTR_OC (1U<<30) /* Ownership change */ +#define OHCI_INTR_MIE (1U<<31) /* Master Interrupt Enable */ #define OHCI_HCCA_SIZE 0x100 #define OHCI_HCCA_MASK 0xffffff00 @@ -253,7 +253,7 @@ struct ohci_iso_td { #define OHCI_FMI_FSMPS 0xffff0000 #define OHCI_FMI_FIT 0x80000000 -#define OHCI_FR_RT (1<<31) +#define OHCI_FR_RT (1U<<31) #define OHCI_LS_THRESH 0x628 @@ -265,12 +265,12 @@ struct ohci_iso_td { #define OHCI_RHA_NOCP (1<<12) #define OHCI_RHA_POTPGT_MASK 0xff000000 -#define OHCI_RHS_LPS (1<<0) -#define OHCI_RHS_OCI (1<<1) -#define OHCI_RHS_DRWE (1<<15) -#define OHCI_RHS_LPSC (1<<16) -#define OHCI_RHS_OCIC (1<<17) -#define OHCI_RHS_CRWE (1<<31) +#define OHCI_RHS_LPS (1U<<0) +#define OHCI_RHS_OCI (1U<<1) +#define OHCI_RHS_DRWE (1U<<15) +#define OHCI_RHS_LPSC (1U<<16) +#define OHCI_RHS_OCIC (1U<<17) +#define OHCI_RHS_CRWE (1U<<31) #define OHCI_PORT_CCS (1<<0) #define OHCI_PORT_PES (1<<1)