Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp312405ybe; Wed, 4 Sep 2019 20:49:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWAYlItmkplx581eHfABvHKlBKfjAvSLxWLY52rCUGN9OOucbJEXc7wFtcKlA27pvWcf2r X-Received: by 2002:a17:90a:1d0:: with SMTP id 16mr1533063pjd.98.1567655356916; Wed, 04 Sep 2019 20:49:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567655356; cv=none; d=google.com; s=arc-20160816; b=lV+3AbbvJIjWCMO4g8VZ9POHe6Q66OdXNw3M3EEEgFHCvuTDm/QvCfoowJVlneW43p LunlYztaagCKxApXBwHwDxlFmh/lm3tb7zLYp1qWNWdMHYRVV1426jeL43eziXvph5MC wwapAzqKpnSxFat0ikRYL67HhQ+EYjf+kvrrVaqYO0NQ7J+0Zt9vdik8R4+/FGn/JyH+ E6iWi4uSgJm8f7Sc3IGDGS1i8LT8vR1tfb8KymUJfNcwJ50mh0eFe3Fzt9SOIZZKk7av zl2RQdaY3Vbp5beHXN0F+5cYYitiyILvl3xEcm9doZsLgURmUUT5VdROZGWAoCLbuN1F B4yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:user-agent:dkim-signature :dkim-signature; bh=iz5b5ME3PsMsS8QeBujZtb3JCi3nja+Hla+LmculZwk=; b=OiIlpfa1m2MPB2ybfFdjayOj4PugZtrzdImxzY6rfJ5shsCvepC90yYvPNxXsgr/yH diqbTLxYq4Ph7nFY2l0ipDSeqWs5sbWi+KbtYf4ipH2/onoMCRlVzSbkMkWTtCzLhDez p2ijCgvjErG6xLdrIJfdEYh5p2YHNnR9gYnr6j3SCbxON51QEeVKz2m/9mOXE6KY/xHl Ibe/3cZ1vVjYjKXDuwCq6P4diS1ZK3dkSsaor4dj4B7U4litODqxCs1UEKQxT1DGRukL 2SbdQBvkJ+NeT6BUjYl+n486Q0ojGGRpXnuFBFvG6/d32SDHDjq+ATcqS1Va6pxeb/Iu k/Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm3 header.b=b4epihcJ; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=RSh87SEs; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i187si814048pfe.21.2019.09.04.20.49.01; Wed, 04 Sep 2019 20:49:16 -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=@aj.id.au header.s=fm3 header.b=b4epihcJ; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=RSh87SEs; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731068AbfIEDrK (ORCPT + 99 others); Wed, 4 Sep 2019 23:47:10 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:40289 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730628AbfIEDrK (ORCPT ); Wed, 4 Sep 2019 23:47:10 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8A30C21391; Wed, 4 Sep 2019 23:47:08 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute4.internal (MEProxy); Wed, 04 Sep 2019 23:47:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm3; bh=iz5b5ME3PsMsS8QeBujZtb3JCi3nja+ Hla+LmculZwk=; b=b4epihcJys2LL8YoCM/nc8qGbEazvW2vWIO1hIVaP9napuP AgLUK/SA4LCbYT07PHOJ76rcWRjJwmhK+SpzqL7QUuBCTXcnnP/NuS/jUcSWKWzR AY8hwGjvJfCsQg7OOdgu5uDvLXf2aR/h1d69gfjGE1RPPjYZLKdfY419TQ1VBZHE LEj5vLwO/Y31rQ//yYbd4S5Hj8fp7R3T9M8tHJmJxXAgwOVFF6bJwPJ8wjnx2N88 oKI2W8VJ1Y8Yi/Usv0DAICA8Rs6J/to+LLrz+l2sQWGppJSjp3qsGRg/r6Cv3zGH hQI2yfJdSUzasOhqLIEuQ6yOrP/u1ng0xIZuiXQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=iz5b5M E3PsMsS8QeBujZtb3JCi3nja+Hla+LmculZwk=; b=RSh87SEs4Y5wMEQGhMF4TS cTeVYM8QeCyqZt+S3kg5/alKN3LfJRrDYbL4QebKdEuKDXl/WvhnqtRC/LIH9ufS YH2RPnAIdDbVRv7NWv0/3BVCF4BB6uzAB0BN7X+Q3aoTaYgUL6OBuKR2I/B+szBf CBWcbyXTo06rhy1TceChRX0UlnEP362/efTMCe4Ho+iPbaW/2ZwQwA4sCte2oHj3 PbkeQV+WaA7MuB63+2wybuenW63wBIt2Q+4LAgcHVm41dBadp3X8dFHqtRwJSvwb 5rooHlU2LFk+U6icJyVPkgFmKUf/GAGABGAoCC1uMsEyrj9ga+YlfSGpxXXIiy4g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudejiedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdetnhgu rhgvficulfgvfhhfvghrhidfuceorghnughrvgifsegrjhdrihgurdgruheqnecurfgrrh grmhepmhgrihhlfhhrohhmpegrnhgurhgvfiesrghjrdhiugdrrghunecuvehluhhsthgv rhfuihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 77709E00A3; Wed, 4 Sep 2019 23:47:07 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-186-gf4cb3c3-fmstable-20190904v1 Mime-Version: 1.0 Message-Id: <5f3ec58f-d83b-41f9-80ed-35a5434bb985@www.fastmail.com> In-Reply-To: <20190905011635.15902-1-rashmica.g@gmail.com> References: <20190905011635.15902-1-rashmica.g@gmail.com> Date: Thu, 05 Sep 2019 13:17:33 +0930 From: "Andrew Jeffery" To: "Rashmica Gupta" , "Linus Walleij" Cc: "Bartosz Golaszewski" , "Joel Stanley" , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/4] gpio/aspeed: Fix incorrect number of banks Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 5 Sep 2019, at 10:46, Rashmica Gupta wrote: > The current calculation for the number of GPIO banks is only correct if > the number of GPIOs is a multiple of 32 (if there were 31 GPIOs we would > currently say there are 0 banks, which is incorrect). > > Fixes: 361b79119a4b7 ('gpio: Add Aspeed driver') > > Signed-off-by: Rashmica Gupta Reviewed-by: Andrew Jeffery > --- > drivers/gpio/gpio-aspeed.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c > index 9defe25d4721..b83e23aecd18 100644 > --- a/drivers/gpio/gpio-aspeed.c > +++ b/drivers/gpio/gpio-aspeed.c > @@ -1165,7 +1165,7 @@ static int __init aspeed_gpio_probe(struct > platform_device *pdev) > gpio->chip.base = -1; > > /* Allocate a cache of the output registers */ > - banks = gpio->config->nr_gpios >> 5; > + banks = DIV_ROUND_UP(gpio->config->nr_gpios, 32); > gpio->dcache = devm_kcalloc(&pdev->dev, > banks, sizeof(u32), GFP_KERNEL); > if (!gpio->dcache) > -- > 2.20.1 > >