Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2515314imu; Thu, 17 Jan 2019 16:02:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN42sSO35uvTd6vc/rOSmcvtCTD/4gMf5n7Mz3QB0T9VkbOihk5TartoaRZT/BZWyc+MbDa/ X-Received: by 2002:a17:902:b48b:: with SMTP id y11mr16440416plr.200.1547769768828; Thu, 17 Jan 2019 16:02:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547769768; cv=none; d=google.com; s=arc-20160816; b=dr9U1oGVxuDG1NnLTikiMGuRDbnkOAagkEgUcb/2aIEeIiBkbqo0SUaKxMlpoi+mcq 7wI4qG1V0Y4uysree3noiHOkEFKVdqCnQJejtqtZoidL7b9i3qXV5pNKVuKb1eGUPn/Q i35tZG4ZkEwh2T0sSH/iqNzv2XRVA8as1yCWfnTrRUDz0PQ//s87nSNoirnON1iGcQx6 Tp3kAmU1CBdRN3FZvf8rrb+oswrSVNz+Yr8eZDZR+giY4wLtgb7yMq1pkBdzeOoCVS6S IUVj/mkH2dGvuCrMKTunXEHVlNUXYmISVMIVLbn3AXrE4EGyuiUbt8CN7KyiHjiVI8Kq E9uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=M+/It5kTEdXJNplczT6lfSARNCXNp0MHT/K3+fn6ZJM=; b=a3AfPw+JpDV65itzma361P8oYB8jZnkg4rwNlQXBceJL1ntyMLwq/ET8EzMVZ4ZKZz /4bbVbVonmtpsiWQDKej2Ya27zrr2nwayZBwhoPsoV6/fC6Cr2ChxFtObEL8+6JcwfCG kG/1Px4GpTJs2bFdhghl6gxt1rpU+OHK/yx8MicqQm3oQ7pnc1rK7eEeG00WdbZ3qREq Nz5kg0FBBoJY0foifV2tDDEiiwc237VZovktvstLn091SXE2g8vD/vhz2hMjCO9U45NJ YmXF2u+pnbX6Bfi/uiu1J7vTu19v1FF940YXc1v9juJZmLtJjf2/Uma8hvXlyjiLm5za LR8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=GaRT4P7W; 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=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h20si2816091pgm.366.2019.01.17.16.02.32; Thu, 17 Jan 2019 16:02:48 -0800 (PST) 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=fail header.i=@crapouillou.net header.s=mail header.b=GaRT4P7W; 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=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726802AbfAQWqK (ORCPT + 99 others); Thu, 17 Jan 2019 17:46:10 -0500 Received: from outils.crapouillou.net ([89.234.176.41]:47682 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725784AbfAQWqJ (ORCPT ); Thu, 17 Jan 2019 17:46:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1547765166; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=M+/It5kTEdXJNplczT6lfSARNCXNp0MHT/K3+fn6ZJM=; b=GaRT4P7WFllQLmlamgMMJuZ3YN2sYutmmQBGumrBScMtRGZ0Zgu8zas7JMXUNi1b0XUQ/0 OjKJw49bkdd/baw4pRdAGxxF0p6ScmXjEWf4xpuA5vpj+lvlWTNhVcv/V646yEC53clczT ewxAnhVYiqNMacn6liEhBdO0CCzZzNM= From: Paul Cercueil To: Rob Herring , Mark Rutland , Miquel Raynal , Boris Brezillon Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH 3/4] memory: jz4780-nemc: Reduce size of const array Date: Thu, 17 Jan 2019 19:45:49 -0300 Message-Id: <20190117224550.18043-3-paul@crapouillou.net> In-Reply-To: <20190117224550.18043-1-paul@crapouillou.net> References: <20190117224550.18043-1-paul@crapouillou.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The maximum value found in that array is 15, there's no need to store these values as uint32_t, a uint8_t is enough. Signed-off-by: Paul Cercueil --- drivers/memory/jz4780-nemc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/memory/jz4780-nemc.c b/drivers/memory/jz4780-nemc.c index bcf06adefc96..ef3f20e46590 100644 --- a/drivers/memory/jz4780-nemc.c +++ b/drivers/memory/jz4780-nemc.c @@ -161,7 +161,7 @@ static bool jz4780_nemc_configure_bank(struct jz4780_nemc *nemc, * Conversion of tBP and tAW cycle counts to values supported by the * hardware (round up to the next supported value). */ - static const uint32_t convert_tBP_tAW[] = { + static const u8 convert_tBP_tAW[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, /* 11 - 12 -> 12 cycles */ @@ -232,7 +232,7 @@ static bool jz4780_nemc_configure_bank(struct jz4780_nemc *nemc, return false; } - smcr |= convert_tBP_tAW[cycles] << NEMC_SMCR_TBP_SHIFT; + smcr |= (u32)convert_tBP_tAW[cycles] << NEMC_SMCR_TBP_SHIFT; } if (of_property_read_u32(node, "ingenic,nemc-tAW", &val) == 0) { @@ -244,7 +244,7 @@ static bool jz4780_nemc_configure_bank(struct jz4780_nemc *nemc, return false; } - smcr |= convert_tBP_tAW[cycles] << NEMC_SMCR_TAW_SHIFT; + smcr |= (u32)convert_tBP_tAW[cycles] << NEMC_SMCR_TAW_SHIFT; } if (of_property_read_u32(node, "ingenic,nemc-tSTRV", &val) == 0) { -- 2.11.0