Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6318127imm; Mon, 23 Jul 2018 15:50:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdE+iJwLlzUlY/5f1hv/ZDO6NJd88KUg5mTf5On3aXmdz/3EdkdKl0cuHxCR1pHyQsx6aWv X-Received: by 2002:a62:df82:: with SMTP id d2-v6mr15106685pfl.189.1532386243613; Mon, 23 Jul 2018 15:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532386243; cv=none; d=google.com; s=arc-20160816; b=CfEi03mbNNCe+oL0q+gtSBgAoUKJrH2TYdVjxVKkdCzqiBOvitxtuIVfWWmwtKyw4u J65F3zo8wi+8ASD/yz8F/qzt9qVkgD0m5EUYpXANgtOSyahfowuwLvdCXI0i3Q3ci6hh 8WZjM9nxBjrwevF+L4chSLzCErRZaCbUyuhvcDrf4UVwcREV7l7xvpG+H7NqvVTrUwKJ 1M6v16z9+a1JdswSahsELZv5iC0IUju5QQ25hBdKg/jDQWnn81lxchc+as7bXE00TbZx UjK+ThzYqiJ7Phc+ldZ3e/pZlHJ7Sg/Ya0M440S8FuEH6QuxKb+b6VywO8MC5aVQ9eHU VKlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references:message-id :in-reply-to:date:mime-version:dkim-signature :arc-authentication-results; bh=LRx61XYR9pf5fEAAUGx24kr7W9bPqHXVvdzSEsUiWQ4=; b=KGlmeJ7snmwjU9Ge22OjdgLPHMbEp73Oo2MEcytSdzcIP4doUts0rm9QJiEe3C8N20 8ZU+oXe8X2SgMIu6qhyPvmwZXc2N7XS2IZHwoIieDgscgtu0fEfI//PxUt0WTJlYyGA0 kAJdBFQGkYVZZYwix60LYGkrQ1Io+tOuT0ZzRB0fkUafMSfCPkltGFJ3eGdr3ZXY2lZa Jfw/WU/0nUnNYBveoXU4AqVV/X1siff7kjiCmGD9y7mAp8XVmrA4YL/uMYTlfE3ZSJMy XnkgWOLPYWtb05ZHcIRUptYG+1JXK2uK8XsWUDj7IKaP4bMOVHluhjYI3WM2ukfoLFfm 5LKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="V6wd/YD0"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e21-v6si9970190pgl.148.2018.07.23.15.50.28; Mon, 23 Jul 2018 15:50:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="V6wd/YD0"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388336AbeGWXvO (ORCPT + 99 others); Mon, 23 Jul 2018 19:51:14 -0400 Received: from mail-qt0-f201.google.com ([209.85.216.201]:51351 "EHLO mail-qt0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388207AbeGWXvO (ORCPT ); Mon, 23 Jul 2018 19:51:14 -0400 Received: by mail-qt0-f201.google.com with SMTP id x9-v6so1705258qto.18 for ; Mon, 23 Jul 2018 15:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:date:in-reply-to:message-id:references:subject:from:to :cc; bh=LRx61XYR9pf5fEAAUGx24kr7W9bPqHXVvdzSEsUiWQ4=; b=V6wd/YD0V2EYi767x7u3LXlGPHc1UkuM/K3vwzAET3rxvfP0Uc40MovK7jlDOrayhO TrFfBw+I2sekgYCE0c0UBDbSimZ8EmsLRK1uj1VNqyOCnTKK+YJ3OWcFq4FExev+KbWR 2yZoJR/h4TtPk138ZuaoIaVCEU3QNzBAP4Dw4bEWK6uLCFOpumQA0IrvM4iqKKyQke2Y lUO1P7aNQxh38zxDmnQzatubNp0zx3PiZ5d79DRZPrAfflu5M/IPY6oFCrsuuiHP/kFj o+HtTgHLbNJ8pzWOrPUrMskoSM2O9TWOGdH12UH/hNc9fuvZDk/hpJIPYc4c6uWpltN/ g/Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:in-reply-to:message-id :references:subject:from:to:cc; bh=LRx61XYR9pf5fEAAUGx24kr7W9bPqHXVvdzSEsUiWQ4=; b=ZJsnSTQAkhG8ySHQnHHcwV2T+tHM8DrkoC+B9KX2jWgm4iSv3ft+piws0vEtyXcC+l JjK3NS9dEGq1JGHaD/0Hb8POwt3xKVZswQrgk7TIbqBXvC7QfocDDuQ9wG1msmYvtPWm UjFBsvxD3139xV72yYi/ZblA2MxBBj2GaKGmurGeOGO5vz+Ic8Bs5a2HML3feluekRbg N6lzfDuNSM1qpqSaTo2t/aoLTYKRb2PlTnNQQ6Hztxy7Jg5O0T9E97ircxn/3u/9pJif jQ9QF8hzLr5thF4IjFmN7GXMb04gFrg5769xDGlXVAm1JAkUN4vIvTjXh5unZX4VhbuB NK4g== X-Gm-Message-State: AOUpUlHvP30gL8rDDr3dxhg14hg3JIijMP73oMlgwGml8asxlv3MjKMC rneAo1NHANlMyQFO5GFYITki691O MIME-Version: 1.0 X-Received: by 2002:a0c:f70d:: with SMTP id w13-v6mr7845178qvn.20.1532386068779; Mon, 23 Jul 2018 15:47:48 -0700 (PDT) Date: Mon, 23 Jul 2018 15:47:27 -0700 In-Reply-To: <20180723224727.120952-1-rkir@google.com> Message-Id: <20180723224727.120952-2-rkir@google.com> References: <20180723224727.120952-1-rkir@google.com> X-Mailer: git-send-email 2.18.0.233.g985f88cf7e-goog Subject: [PATCH 2/2] goldfish: Use dedicated macros instead of manual bit shifting From: rkir@google.com To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, tkjos@google.com, Roman Kiryanov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roman Kiryanov There are dedicated macros (lower_32_bits and upper_32_bits) available to extract the lower and upper 32 bits. They provide better readability and could prevent some compilation warnings. Signed-off-by: Roman Kiryanov --- include/linux/goldfish.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/linux/goldfish.h b/include/linux/goldfish.h index 159b4191f15d..265a099cd3b8 100644 --- a/include/linux/goldfish.h +++ b/include/linux/goldfish.h @@ -2,6 +2,7 @@ #ifndef __LINUX_GOLDFISH_H #define __LINUX_GOLDFISH_H +#include #include #include @@ -10,9 +11,11 @@ static inline void gf_write_ptr(const void *ptr, void __iomem *portl, void __iomem *porth) { - writel((u32)(unsigned long)ptr, portl); + const unsigned long addr = (unsigned long)ptr; + + writel(lower_32_bits(addr), portl); #ifdef CONFIG_64BIT - writel((unsigned long)ptr >> 32, porth); + writel(upper_32_bits(addr), porth); #endif } @@ -20,9 +23,9 @@ static inline void gf_write_dma_addr(const dma_addr_t addr, void __iomem *portl, void __iomem *porth) { - writel((u32)addr, portl); + writel(lower_32_bits(addr), portl); #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT - writel(addr >> 32, porth); + writel(upper_32_bits(addr), porth); #endif } -- 2.18.0.233.g985f88cf7e-goog