From patchwork Thu May 8 18:46:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 29858 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D9218202DD for ; Thu, 8 May 2014 18:51:59 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id y10sf11252227pdj.7 for ; Thu, 08 May 2014 11:51:59 -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=0aI6ijSm9tUmgN6NhwDu9FttXryooiCDLDh1eeYQp/4=; b=TblqMOWA/yWl8L9fVR7CnahZqij89jFxc9T32QwqLON5P1onyj4vQqS6lBWWiAG1k8 NSFTRUvmZ6bZ16CcSldiphWFAJOcg3/ZSXxSZtlAXMVrvE0vDrTL9b4oP01x+QGo6wR5 AS8tyguuXkDHVbQkuCjrVMnlzNEKvS1/q2NuJPng3ZVvpKpjDJcGmIiNlWOyOWB+I1vg gFncBkZIZ1Mp7bS5pfGf7DUcLYXxHynxXSdVSrAKX2YAXMCVqP4Gh7MqCDBMu/ffa5aq E09o/5BWUXA6VSBfVOIyCesYNHViH1E7oV1qD74NTL0kBjrh9WGXhzB1OEqLldW+AwNl R5WA== X-Gm-Message-State: ALoCoQn8eiDjXBcBnRgqxdrzIz6kJo+/vWYSWwkYCRyxcFjE55vQSHsXVzfoIBAKI7hqKG8Ye8i5 X-Received: by 10.66.180.77 with SMTP id dm13mr2474pac.43.1399575118906; Thu, 08 May 2014 11:51:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.234 with SMTP id a97ls2087926qgf.51.gmail; Thu, 08 May 2014 11:51:58 -0700 (PDT) X-Received: by 10.58.150.68 with SMTP id ug4mr2112126veb.50.1399575118532; Thu, 08 May 2014 11:51:58 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id b2si325700vcy.10.2014.05.08.11.51.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 May 2014 11:51:58 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id oy12so3831597veb.38 for ; Thu, 08 May 2014 11:51:58 -0700 (PDT) X-Received: by 10.221.40.193 with SMTP id tr1mr4312572vcb.31.1399575118424; Thu, 08 May 2014 11:51:58 -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.221.72 with SMTP id ib8csp17315vcb; Thu, 8 May 2014 11:51:58 -0700 (PDT) X-Received: by 10.140.101.99 with SMTP id t90mr7365262qge.115.1399575118030; Thu, 08 May 2014 11:51:58 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x1si928328qal.234.2014.05.08.11.51.57 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 08 May 2014 11:51:58 -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]:48834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiTQD-0006jF-Nc for patch@linaro.org; Thu, 08 May 2014 14:51:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiTLb-0000YR-O2 for qemu-devel@nongnu.org; Thu, 08 May 2014 14:47:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiTLS-0006Ef-AT for qemu-devel@nongnu.org; Thu, 08 May 2014 14:47:11 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:48064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiTLS-0006Dw-3i for qemu-devel@nongnu.org; Thu, 08 May 2014 14:47:02 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WiTLO-00052r-Qz; Thu, 08 May 2014 19:46:58 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 8 May 2014 19:46:55 +0100 Message-Id: <1399574818-19349-6-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1399574818-19349-1-git-send-email-peter.maydell@linaro.org> References: <1399574818-19349-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: Peter Crosthwaite , patches@linaro.org Subject: [Qemu-devel] [PATCH 5/8] hw/dma/omap_dma: Add (uint32_t) casts when shifting uint16_t by 16 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: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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 Add missing (uint32_t) casts in cases where we're trying to put a uint16_t value into the top half of a 32-bit field. These were already present in some but not all places. Signed-off-by: Peter Maydell Reviewed-by: Peter Crosthwaite --- For new code or code I cared about I'd use deposit32(); but omap is pretty ancient and unloved, so this is the minimal fix. --- hw/dma/omap_dma.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c index 0e8cccd..0f35c42 100644 --- a/hw/dma/omap_dma.c +++ b/hw/dma/omap_dma.c @@ -973,7 +973,7 @@ static int omap_dma_ch_reg_write(struct omap_dma_s *s, case 0x22: /* DMA_COLOR_U */ ch->color &= 0xffff; - ch->color |= value << 16; + ch->color |= (uint32_t)value << 16; break; case 0x24: /* DMA_CCR2 */ @@ -1043,7 +1043,7 @@ static int omap_dma_3_2_lcd_write(struct omap_dma_lcd_channel_s *s, int offset, case 0xbca: /* TOP_B1_U */ s->src_f1_top &= 0x0000ffff; - s->src_f1_top |= value << 16; + s->src_f1_top |= (uint32_t)value << 16; break; case 0xbcc: /* BOT_B1_L */ @@ -1265,7 +1265,7 @@ static int omap_dma_3_1_lcd_write(struct omap_dma_lcd_channel_s *s, int offset, case 0x304: /* SYS_DMA_LCD_TOP_F1_U */ s->src_f1_top &= 0x0000ffff; - s->src_f1_top |= value << 16; + s->src_f1_top |= (uint32_t)value << 16; break; case 0x306: /* SYS_DMA_LCD_BOT_F1_L */ @@ -1275,7 +1275,7 @@ static int omap_dma_3_1_lcd_write(struct omap_dma_lcd_channel_s *s, int offset, case 0x308: /* SYS_DMA_LCD_BOT_F1_U */ s->src_f1_bottom &= 0x0000ffff; - s->src_f1_bottom |= value << 16; + s->src_f1_bottom |= (uint32_t)value << 16; break; case 0x30a: /* SYS_DMA_LCD_TOP_F2_L */ @@ -1285,7 +1285,7 @@ static int omap_dma_3_1_lcd_write(struct omap_dma_lcd_channel_s *s, int offset, case 0x30c: /* SYS_DMA_LCD_TOP_F2_U */ s->src_f2_top &= 0x0000ffff; - s->src_f2_top |= value << 16; + s->src_f2_top |= (uint32_t)value << 16; break; case 0x30e: /* SYS_DMA_LCD_BOT_F2_L */ @@ -1295,7 +1295,7 @@ static int omap_dma_3_1_lcd_write(struct omap_dma_lcd_channel_s *s, int offset, case 0x310: /* SYS_DMA_LCD_BOT_F2_U */ s->src_f2_bottom &= 0x0000ffff; - s->src_f2_bottom |= value << 16; + s->src_f2_bottom |= (uint32_t)value << 16; break; default: