From patchwork Fri Oct 16 13:14:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 7418661 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9CB659F6CD for ; Fri, 16 Oct 2015 16:12:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4F4420A7C for ; Fri, 16 Oct 2015 16:12:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C6E1020A80 for ; Fri, 16 Oct 2015 16:12:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E28596E176; Fri, 16 Oct 2015 09:12:41 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6CB5E6F00E for ; Fri, 16 Oct 2015 06:15:22 -0700 (PDT) Received: by lffy185 with SMTP id y185so79371517lff.2 for ; Fri, 16 Oct 2015 06:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id; bh=EcWvtxSn6MRLZdTzxTSBOz+xRnYZQV6foGPLP6CWf4g=; b=XrOGwzErpOQtaETnJVaYjVtjpcElDOF6/d9mts8LqBQSnMyHcuBSerGvQ5ZsquLL4S HpbMqkm1jEydCipFB/U3o9jeXDjiMqHtW0zij6R770jmuXm65e1IcKKAV1qIZasU6C7J PRfl2oIOTfGjxPw2+33bSoQ1iwj3+s57Wms34= 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; bh=EcWvtxSn6MRLZdTzxTSBOz+xRnYZQV6foGPLP6CWf4g=; b=JdMlvZX1vCKqHdLuX2i5J3wlvWT7wdPoi4kKlPr3YArBh4xLzDkwBPQ0THZbBJEf2S /Uo8i9uvyW61ItwTN9GUyhE20lTAs5HXP8MV++4XFukjABD5xN6X2wUmP+xvxXnRFXSm QQA1kpBDdkOVKKNI2z33w4xWZncODrkqiw7rNLc4C/Mf2jjtQJJK2pJphgSN3oxsI9R4 dnsHb2dCk9lo5v1Io6uClpceD0adofXZSQvZXridjw6GNV3IDfVpkY77CK1FzO6Jtt0b ZtK0mOnqfSzaT3uWoGT6Q8ctdhQHpgredzlfhUTpWwOTdqCTYJgWzXQ4ej2U1St9ti+3 jTrA== X-Gm-Message-State: ALoCoQmcXSz5H5vVc0EUFN61mhdlu7h9o3Tr0ZA4WIxn5Ab4EZhrl1cP58vXf+W1AMPHDdI6kG6v X-Received: by 10.25.142.203 with SMTP id q194mr5369194lfd.83.1445001319104; Fri, 16 Oct 2015 06:15:19 -0700 (PDT) Received: from garcia.imf.au.dk ([130.225.20.51]) by smtp.gmail.com with ESMTPSA id am7sm2838306lbc.25.2015.10.16.06.15.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Oct 2015 06:15:18 -0700 (PDT) From: Rasmus Villemoes To: Benjamin Gaignard , Vincent Abriou , David Airlie Subject: [PATCH] drm: sti: remove redundant sign extensions Date: Fri, 16 Oct 2015 15:14:55 +0200 Message-Id: <1445001296-23029-1-git-send-email-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.6.1 X-Mailman-Approved-At: Fri, 16 Oct 2015 09:12:39 -0700 Cc: Rasmus Villemoes , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP arg is long int, so arg = (arg << 22) >> 22 makes the upper 22 bits of arg equal to bit 9 (or bit 41). But we then mask away all but bits 0-9, so this is entirely redundant. Signed-off-by: Rasmus Villemoes --- gcc seems to be smart enough to realize this - the generated code is the same. This is thus just a tiny cleanup. drivers/gpu/drm/sti/sti_awg_utils.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_awg_utils.c b/drivers/gpu/drm/sti/sti_awg_utils.c index 6029a2e3db1d..00d0698be9d3 100644 --- a/drivers/gpu/drm/sti/sti_awg_utils.c +++ b/drivers/gpu/drm/sti/sti_awg_utils.c @@ -65,7 +65,6 @@ static int awg_generate_instr(enum opcode opcode, mux = 0; data_enable = 0; - arg = (arg << 22) >> 22; arg &= (0x3ff); break; case REPEAT: @@ -77,14 +76,12 @@ static int awg_generate_instr(enum opcode opcode, mux = 0; data_enable = 0; - arg = (arg << 22) >> 22; arg &= (0x3ff); break; case JUMP: mux = 0; data_enable = 0; arg |= 0x40; /* for jump instruction 7th bit is 1 */ - arg = (arg << 22) >> 22; arg &= 0x3ff; break; case STOP: @@ -94,7 +91,6 @@ static int awg_generate_instr(enum opcode opcode, case RPTSET: case RPLSET: case HOLD: - arg = (arg << 24) >> 24; arg &= (0x0ff); break; default: