Message ID | 5581771d86df1abaf33545ccd60caf4db7ad3c5e.1605893643.git.syednwaris@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=Tevr=E2=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F142C56201 for <linux-arm-kernel@archiver.kernel.org>; Fri, 20 Nov 2020 17:49:36 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 828AE22240 for <linux-arm-kernel@archiver.kernel.org>; Fri, 20 Nov 2020 17:49:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Rm3kbcPn"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VuHTdBnu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 828AE22240 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mP0p4ZfEIGVceobMsU2QEl3YRIm+dVnFHfz/Th/6Ehc=; b=Rm3kbcPnt4L93n5lSoTfxDx27 fddoxeOuPX49jhya77CKRYtyYyV0XllpcqLIK2DGlsbMWzJ+60xSY6Zg4GYraQ1OWJBmIIj8J9XS/ jLcvki8gsDNCsdVfTU9zDNkC0fqrx9QBwkIb5FM4C93Zqmq3VV0sHg1J/OpIX6gfq93PKuOB3fxBq 6zMSfr1SIL/C16mEXAeJ4ea95oOG71srJcy/TYU+yUaGMkMJHwaKZKx0Pka3tmsm8jGwjUI7Z1FjW uSwxEoYXC2L8BUTGXkrW21NPVoBU7Ke1wTn4qPQATnkUSRqWEWdEG24aVU/lbNfanZpN145+IN/Wv vCM8baW5A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgAWI-00046L-9x; Fri, 20 Nov 2020 17:48:26 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kgAWF-00044s-Nx for linux-arm-kernel@lists.infradead.org; Fri, 20 Nov 2020 17:48:24 +0000 Received: by mail-pg1-x542.google.com with SMTP id q28so7914579pgk.1 for <linux-arm-kernel@lists.infradead.org>; Fri, 20 Nov 2020 09:48:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Yy8mAP2XRxcUpsdCsTm+KdTXMmpuQJot11SefIetIN0=; b=VuHTdBnuHwGkq10ElqUJ8YPGsbNvZ5vJJtt345M1qoUcGa3PYxR4lS7NACyEa+776y 25Cok+kYcBGNapvo76mDOaCx8R2BhsQd67Zihv5M92ISuwt+n+e197ksp/H9yZz5VV+/ ADTwNtS4gbRFYkl+arTBx2OS0264zqmjJ2ndkSB/48sDHXwgG4IwXqArceJsjSnxlWxf sUjVZ4YMgL5Aw4nKwy3LDKR75YoSGXaAZCzQ/kskAh7Q9IFmzf/ggVl5bZkIqyDkWZ0t 9aIWKV1ISFUpBCLK2/LFkJgp345efuZZCPzuoptlJ4cPGAB6IPJ6YDMAr0H3vX9kBXfW vSNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Yy8mAP2XRxcUpsdCsTm+KdTXMmpuQJot11SefIetIN0=; b=XXKc+NtI3T2HfSFWu/GRWuioyUAYdTgFsRhs5JQ+LKtzuiLhkNrKG8TNbuNyzSVgsx VCSoXuouwUdjJ00tRvf2tLVy8cEDRjCWqx3DKTYGap8BL3eMsKrCfrT9cC41hW3azAFA jVuGSHdkA5DNgsxvjp5DCZnUH0870IbjoiUDCLpwa2BG1Q1/ZA43YS+6kBwtQCCbY5Fx H3UHTQgS+FgPbudd7F9Bb6QR/t17vXJSNO8vsPZIqtnCb+7EOPbZib68Nbscy0ZtcZlZ FogXQYe+iBBJPdgVDJ2FxT8k578mkUSZ8Lt+eSnmcbsiuQN4YTdPaRHURUSuzew1WLQb RiiQ== X-Gm-Message-State: AOAM533s9eoq88mMGwBUvDunpHHwkW1wHJ3k9nSdWyQPTNsrv5rUtL4m lQz7t/fzLMMEJx+KcR42naA= X-Google-Smtp-Source: ABdhPJypIr3JQuMN0qO4OWeuGSIuRkEhb9DiluX5rcaHCu1V7dwikNflgns/SgKwMc7WyNCqdpQDvw== X-Received: by 2002:a17:90b:38e:: with SMTP id ga14mr10935553pjb.45.1605894501500; Fri, 20 Nov 2020 09:48:21 -0800 (PST) Received: from syed ([2401:4900:2e82:cfda:fc82:287b:3e19:db98]) by smtp.gmail.com with ESMTPSA id 184sm4533205pfc.28.2020.11.20.09.48.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Nov 2020 09:48:20 -0800 (PST) Date: Fri, 20 Nov 2020 23:18:05 +0530 From: Syed Nayyar Waris <syednwaris@gmail.com> To: akpm@linux-foundation.org Subject: [PATCH 4/4] gpio: xilinx: Add extra check to see if sum of widths exceed 64 Message-ID: <5581771d86df1abaf33545ccd60caf4db7ad3c5e.1605893643.git.syednwaris@gmail.com> References: <cover.1605893641.git.syednwaris@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <cover.1605893641.git.syednwaris@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201120_124823_818077_FACB624C X-CRM114-Status: GOOD ( 14.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, vilhelm.gray@gmail.com, michal.simek@xilinx.com, bgolaszewski@baylibre.com, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Modify bitmap_set_value() to suppress compiler warning
|
expand
|
diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c index 05dae086c4d0..a2e92a1cf50b 100644 --- a/drivers/gpio/gpio-xilinx.c +++ b/drivers/gpio/gpio-xilinx.c @@ -340,6 +340,12 @@ static int xgpio_probe(struct platform_device *pdev) chip->gc.base = -1; chip->gc.ngpio = chip->gpio_width[0] + chip->gpio_width[1]; + + if (chip->gc.ngpio > 64) { + dev_err(&pdev->dev, "invalid configuration: number of GPIO is greater than 64"); + return -EINVAL; + } + chip->gc.parent = &pdev->dev; chip->gc.direction_input = xgpio_dir_in; chip->gc.direction_output = xgpio_dir_out;
Add extra check to see if sum of widths does not exceed 64. If it exceeds then return -EINVAL alongwith appropriate error message. Cc: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Syed Nayyar Waris <syednwaris@gmail.com> --- drivers/gpio/gpio-xilinx.c | 6 ++++++ 1 file changed, 6 insertions(+)