From patchwork Fri May 9 13:22:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 29904 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 92AA1202FE for ; Fri, 9 May 2014 13:22:58 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id ar20sf3501664iec.0 for ; Fri, 09 May 2014 06:22:57 -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:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=CI3ZddrJ/VQXbGJXirXoe3Z1LXqkf19PnW1uZHCjGEA=; b=LmI7jkCmOZLC/ZvK7nLj003CUjegvyht1JoAtUqH22GX4tTZ4iVZavkaFb8Zp0Cx1c SBc1vvZo9L5vpAbgBMy4FZfB9lvr6YdyI4UwZrkyi7hv1t3yPD5E7Aqw0vUFnXivfpU+ 5IfA95+0aTDr4LQikjvI9JKErzfL9P+ib8BElAsWQTN8Fox/McqJQX/d0ZLsJRRbrxeK UjBzWIyuW0V8qKbxz4MLbAvQIFwCcVsXsYaCnBaVjSLXgCZOF848PTIEVlIr0iVxlpY/ dlbtjX3ZPM8Mhu9to4pODD6raq+DSHJtvti0yz9RHrwCqO3pgu7PbqoFpmTyg4EtI/Sg WrUg== X-Gm-Message-State: ALoCoQko730SN1DAyqw9NS7MMOBGjJRW0grpZM4np4jo+X20QblPpQ7R1n52iVyWFZZ1VV4Cc5fo X-Received: by 10.182.53.198 with SMTP id d6mr5101713obp.29.1399641777922; Fri, 09 May 2014 06:22:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.107 with SMTP id b98ls337140qgd.64.gmail; Fri, 09 May 2014 06:22:57 -0700 (PDT) X-Received: by 10.52.137.174 with SMTP id qj14mr6994718vdb.32.1399641777778; Fri, 09 May 2014 06:22:57 -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 db15si724155vec.100.2014.05.09.06.22.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 May 2014 06:22:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id oy12so5135258veb.24 for ; Fri, 09 May 2014 06:22:57 -0700 (PDT) X-Received: by 10.220.191.134 with SMTP id dm6mr8434128vcb.16.1399641777653; Fri, 09 May 2014 06:22:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp79184vcb; Fri, 9 May 2014 06:22:57 -0700 (PDT) X-Received: by 10.194.203.137 with SMTP id kq9mr2571471wjc.55.1399641776566; Fri, 09 May 2014 06:22:56 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id cx10si983481wib.70.2014.05.09.06.22.56 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 May 2014 06:22:56 -0700 (PDT) Received-SPF: none (google.com: pm215@archaic.org.uk does not designate permitted sender hosts) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WiklJ-0005Pq-WE; Fri, 09 May 2014 14:22:54 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, "Vassili Karpov (malc)" , Gerd Hoffmann , qemu-trivial@nongnu.org Subject: [PATCH] hw/audio/intel-hda: Avoid shift into sign bit Date: Fri, 9 May 2014 14:22:53 +0100 Message-Id: <1399641773-20793-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add a U suffix to avoid shifting into the sign bit (which is undefined behaviour in C). Signed-off-by: Peter Maydell --- Another one from clang's sanitizer... hw/audio/intel-hda.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index d41f82c..0cec2d2 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -245,7 +245,7 @@ static void intel_hda_update_int_sts(IntelHDAState *d) /* update global status */ if (sts & d->int_ctl) { - sts |= (1 << 31); + sts |= (1U << 31); } d->int_sts = sts; @@ -257,7 +257,7 @@ static void intel_hda_update_irq(IntelHDAState *d) int level; intel_hda_update_int_sts(d); - if (d->int_sts & (1 << 31) && d->int_ctl & (1 << 31)) { + if (d->int_sts & (1U << 31) && d->int_ctl & (1U << 31)) { level = 1; } else { level = 0;