From patchwork Fri Nov 22 07:25:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 179951 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp4709054ilf; Thu, 21 Nov 2019 23:25:15 -0800 (PST) X-Google-Smtp-Source: APXvYqxK8N87DsefA7KyM+/IQuEFmOZHOgHAqahrWybnXm0DNfPFPcr8XNG9xUJ3DLlsopnNvzJr X-Received: by 2002:a17:90a:f00d:: with SMTP id bt13mr17102519pjb.43.1574407515554; Thu, 21 Nov 2019 23:25:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574407515; cv=none; d=google.com; s=arc-20160816; b=qeAFWHNt3zr7lOlhAKqon9mIZnajsQKFwBUj6AbkU7uGjWPTXgSQ2tNqVviife283q 9iw+7HXapbzJBdkXTP9u22eIR0FElspZPnhJDInfWzEnBmI7s7E1Gj4ZwMhXOjeTvIgZ eDVOyFCOTQftLeGbIuoojiIJpceItPkbT6WLoGUVyS/xGeNoIqB4A6RL9A/xWibppEWT dktczCgRuTsRnhX0GIuSfIGeP2gsOLmUIPKdazmQG6doE7Wsm+poGd26FfzQJnL6gywO Hjp8624bwyORAzUJplznJLzo+NlUQQkiPGjWBfLZxvGzF+76kNvtanq1T14Ek0Ixmidy mBtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :delivered-to; bh=0PCnUOWIgqrctqBFr4hrkBm5ENWQM+l8+JUezO8Qb5o=; b=TXpa6AFTGo9p96tAVdvwBT5IvmRX0Mljdr0Jiccyy8a8kIz5BevLwGILZUAEHeSFJT 8o/tY//fMj9lOVEo1D1VS9Zrhy139a+10r3478iz4x6RXznh2PXVwAjEwNpPZeNj0qew iCog/NRxRkkBn3GY1kfpAN7AChZG5Ns6ICiVaMo7J7QxAkHITFnbcx0AnHgn7gfl0hr5 eSZx6LqJBdzHt4Ead3AIPkRX9Qu+FRG8BLQ/jkb00jcBVzFIyHpciSB3rnxsy17/63W5 0B18E5XY8EZUs9qZAWKXGlu4TJH/vOynhnYHy6uFGINyn87HDXx/MGsfDIGekmoOJL+m OgQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id y8si2269764plr.47.2019.11.21.23.25.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Nov 2019 23:25:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 631D46E250; Fri, 22 Nov 2019 07:25:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by gabe.freedesktop.org (Postfix) with ESMTPS id 53EDD6E250 for ; Fri, 22 Nov 2019 07:25:13 +0000 (UTC) Received: by mail-lf1-x142.google.com with SMTP id v201so3667493lfa.11 for ; Thu, 21 Nov 2019 23:25:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XWYrspY3sqn5IhheES0xFmh++L5u8QGvgjG4njd5/Go=; b=gyYjCwuqmdoh6xb57hYvmMyAm7S5/tGB8QJTheNjZ712jDR7inV1zi7mIgOtbQVJLl qKzlUEumDuWTZ1F2oomn/+mCa+KVKFSeV0MM22lkjHW+AuDf5OnnBmhRwuowK1/c7F1N hzXZRcgHhu0+5mxeAm/YVhwTn4QDwIuxYx4+cqx5Z7MeI1svM+GZCTI9PdD4/bBiiy1I +OmtBjDxRMGaFtiqvU7KyOYPlj/4R87Ke8KuKFMVI28O17UnzZ0nmCQPknu8nbzFDC0R JYO7C1T++rt0/Z2rKulBnUyedB326mktlZOl33QnpoIpkj4kkTFcsy0QqHpx3KGYLSCu 73rA== X-Gm-Message-State: APjAAAWTq0HvT8su2XuWV+k7ANERfO3nGkNqnVwsllvI6fPZxKZO9a5p B53++rKATeXz1DHajDuocH6DwZjs438CoA== X-Received: by 2002:ac2:44af:: with SMTP id c15mr11040869lfm.39.1574407511506; Thu, 21 Nov 2019 23:25:11 -0800 (PST) Received: from localhost.bredbandsbolaget (c-21cd225c.014-348-6c756e10.bbcust.telenor.se. [92.34.205.33]) by smtp.gmail.com with ESMTPSA id f14sm2651394lfa.67.2019.11.21.23.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 23:25:10 -0800 (PST) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul Subject: [PATCH 2/2] drm/mcde: Do not needlessly logically and with 3 Date: Fri, 22 Nov 2019 08:25:08 +0100 Message-Id: <20191122072508.25677-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XWYrspY3sqn5IhheES0xFmh++L5u8QGvgjG4njd5/Go=; b=w6oWmXgC7g4lyOX/a2UvHPOQbdHjewIuLYi+MGrVTij75HtwmCU7FSbdL90m7TNcAj EEYW7ekQsCdSpCLowDnFAWips+9Mj75k1D7Gv6RP7fi/s1IOTj0jmNrkJuCBPTJFD+1C fy0HBf7oEipoAIdsfeyeqsDcH/JnOg8+E2fdvffRe34ZgUwQMqctqoQ8mqEtw41kf1GS TCuWW0UlYY9GgvCx3GeNQjAM+c+dzOLLRhf9LVRmAy9OyRsM3AgniRPSwb/+0W95KJ6S JJrVaDlXoDs0ICQ1woZRL5V+v2nfo8/btS3UKwlIOqCKKBv4eSnJUb19CmTbpwSgrvc1 HxvQ== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephan Gerhold , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The i index i always 0..3 in these statements so there is no need to tag "& 3" to clamp it to 3 here. Make the operator precedence explicit even if it's correct as it is, the paranthesis creates less cognitive stress for humans. Cc: Stephan Gerhold Signed-off-by: Linus Walleij Reviewed-by: Stephan Gerhold --- drivers/gpu/drm/mcde/mcde_dsi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c index dc07b534f01f..21cee4d9d2fd 100644 --- a/drivers/gpu/drm/mcde/mcde_dsi.c +++ b/drivers/gpu/drm/mcde/mcde_dsi.c @@ -237,25 +237,25 @@ static ssize_t mcde_dsi_host_transfer(struct mipi_dsi_host *host, if (txlen > 0) { val = 0; for (i = 0; i < 4 && i < txlen; i++) - val |= tx[i] << (i & 3) * 8; + val |= tx[i] << (i * 8); } writel(val, d->regs + DSI_DIRECT_CMD_WRDAT0); if (txlen > 4) { val = 0; for (i = 0; i < 4 && (i + 4) < txlen; i++) - val |= tx[i + 4] << (i & 3) * 8; + val |= tx[i + 4] << (i * 8); writel(val, d->regs + DSI_DIRECT_CMD_WRDAT1); } if (txlen > 8) { val = 0; for (i = 0; i < 4 && (i + 8) < txlen; i++) - val |= tx[i + 8] << (i & 3) * 8; + val |= tx[i + 8] << (i * 8); writel(val, d->regs + DSI_DIRECT_CMD_WRDAT2); } if (txlen > 12) { val = 0; for (i = 0; i < 4 && (i + 12) < txlen; i++) - val |= tx[i + 12] << (i & 3) * 8; + val |= tx[i + 12] << (i * 8); writel(val, d->regs + DSI_DIRECT_CMD_WRDAT3); }