Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3940289pxj; Mon, 21 Jun 2021 09:49:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlsWtFJynqLssmzH1/wE08Jtg5C85GHMwUIlo5RMBoLahnedhbK7DBgoY+UWfnbvX7aIBx X-Received: by 2002:a92:cacf:: with SMTP id m15mr15342669ilq.14.1624294161971; Mon, 21 Jun 2021 09:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624294161; cv=none; d=google.com; s=arc-20160816; b=i/SWYedbhqciELhkPv9Ehxs6KLN0uvrEt+5jzxO6okGcT6zXSTEnNMBoOIPw/4pYQH O4Qjwsc7/G4i2uFJhuYD6stquVgEOIzGmu5h+L5BzVhjpXDLty4jk/N7KqHg1bhN6zPA eHWUF6YcoJlXfVDOerUl3BlOUoiqjA1NUssAwtrvggVo+/nwxALIYjP1wRuntZvqkXWN bX8ZR7XfJEPrXgolPIzFNDjIJlKRdL6+fhnlifMg3AhQ/g8Z9aazm3PPJHMQ8Kn1/kMp EXwiUfgBDrBBbqhKxTBc4IJgCDEEYgzhPErpGaOOjrEn/gUpMPL3yipOXQFgDfERN2Cz rEIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EkwIEzUnAZK8LR3tvDspKLkCWdC2hzwnjdxROxAyxuw=; b=aNmjk4x1pC1jqcJx3HXv0Ouf44bhDcBslOLboFbTgYGtnPC14mU+0d2LIet8YcNbH0 GRV7a/P1fJqBlX5VYIW88ngsqTYGfRVtMTSwGaMXiFXXMGi2CXNsAN5Fn0XMIIqwGnBO 5cgzFqhJ1ewv/cmG87mjvOE7Gox3dGsJRwcoXJsH0NAibZ2u/As4O7IRAR+/bwSi/5nS whj3acB/56SdqgX0IzAJ1N10bshe3V3kWn8cWXjaqRKRiOj803vAoKXmjMRHKoqnUuqw 1YzgE9DICfQRZXdNn+95A9c9dVUUSJh8Yc7wp1PFXmDo4nWIWj7FK7ukG3HlcbnR9HD5 ZxsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oc+wpSKL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u21si19704898jak.34.2021.06.21.09.49.10; Mon, 21 Jun 2021 09:49:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oc+wpSKL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232113AbhFUQug (ORCPT + 99 others); Mon, 21 Jun 2021 12:50:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:37760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231293AbhFUQq2 (ORCPT ); Mon, 21 Jun 2021 12:46:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 95AB860231; Mon, 21 Jun 2021 16:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624293195; bh=ZZw7LqFGgfCHUlgt8fcTCe5QwulDRnNqcaBgTxopqcM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oc+wpSKLWs4Qmfgu3keL4XdD5oIciqc96zuyi8TagAsc8x4NxitA0lsJsmZ/B27wT OsiSaqy8thZFyFHRUMc+K3/xvqbLhe0yokXdIkVvL2tUSsk/Xt1kRi7mLFwy9kS6Y9 1cM5MNTuG40oibYdhs5J8NzyHr/SxvtM592kKDik= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Axel Lin , Mark Brown , Sasha Levin Subject: [PATCH 5.12 100/178] regulator: hi6421v600: Fix .vsel_mask setting Date: Mon, 21 Jun 2021 18:15:14 +0200 Message-Id: <20210621154926.181590113@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154921.212599475@linuxfoundation.org> References: <20210621154921.212599475@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Axel Lin [ Upstream commit 50bec7fb4cb1bcf9d387046b6dec7186590791ec ] Take ldo3_voltages as example, the ARRAY_SIZE(ldo3_voltages) is 16. i.e. the valid selector is 0 ~ 0xF. But in current code the vsel_mask is "(1 << 15) - 1", i.e. 0x7FFF. Fix it. Signed-off-by: Axel Lin Link: https://lore.kernel.org/r/20210529013236.373847-1-axel.lin@ingics.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/staging/hikey9xx/hi6421v600-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/hikey9xx/hi6421v600-regulator.c b/drivers/staging/hikey9xx/hi6421v600-regulator.c index f6a14e9c3cbf..e10fe3058176 100644 --- a/drivers/staging/hikey9xx/hi6421v600-regulator.c +++ b/drivers/staging/hikey9xx/hi6421v600-regulator.c @@ -83,7 +83,7 @@ static const unsigned int ldo34_voltages[] = { .owner = THIS_MODULE, \ .volt_table = vtable, \ .n_voltages = ARRAY_SIZE(vtable), \ - .vsel_mask = (1 << (ARRAY_SIZE(vtable) - 1)) - 1, \ + .vsel_mask = ARRAY_SIZE(vtable) - 1, \ .vsel_reg = vreg, \ .enable_reg = ereg, \ .enable_mask = emask, \ -- 2.30.2