Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp178724imn; Mon, 25 Jul 2022 13:13:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t3xCGH/hVpHiGKOutbcn6CYj3Pf7cfrnwE5aonvux6XI0zKLZS9BbdN0QWJWKzMGPgNbtm X-Received: by 2002:a17:90b:3ec1:b0:1f1:edcf:dd2b with SMTP id rm1-20020a17090b3ec100b001f1edcfdd2bmr16264217pjb.156.1658779992363; Mon, 25 Jul 2022 13:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658779992; cv=none; d=google.com; s=arc-20160816; b=goQDL1tk/tNlnCJQyqFCtZfMJih+Y4Aj6emH8y2dXkEYmCB1zv8Qgdaal7x1LUQtFR 2UTqP9/pa/nQfAHF7Y1X8UrYf/g8XfIeSVQttpeEW4QjQcuMouNIhtxPMzLLX4mmJMqI jZuaqTxf/FnfBglZSELoLcw46VDB6RQf30AER+iZEv++saozzb1TB8AA5S0NnlAfubT2 6pt8wBa70u31IMlF59TScYsLiA7GThOdoqzguGtwCVh3apgxEr4N9m+7SFP14cbxFktW s6rkvgr52CAk9CQ6mevgtbJSwXS5142oBV45H23EENJadOZVJavuZcm7w5I6y6ef35j1 ZuXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IjUjwK3ElFJ8pxv20zoLj+tD6iYdFeeNew4jTmYt/44=; b=esATDibcMC8dL2VTwbWjVwYCK699G/FbmY5AVcpWTAgUVfBDS77QG7aynp5/f21sIs 1Nn05OOeJFVmXAjGi8Dt58hacY45wMvEieUix4l1J+nFeoz7ZRkESDVBJlsiiHJF86X6 tZmW1MSL93dSFHYEWB8YRXrM6EXnKk7wGBfMn7VE31NzAasGXNRARjmnBJxtZgod6hLc +21Sj0dzYAAiEEz09iIwhowZCVogx6jz/9qVPd8rFAQNEBnyRlamGX7AlBlaM1rnE1Jo vOuWfov7EEu5ohDweDlC1zY9k/Ka87+6Yk3z1UWAsUEC+2Wl+EtIchMRqhZ5N+mo9RBz T7yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cGE6CEk0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l62-20020a639141000000b00411f92c19a4si15667811pge.619.2022.07.25.13.12.57; Mon, 25 Jul 2022 13:13:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cGE6CEk0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236666AbiGYUF2 (ORCPT + 99 others); Mon, 25 Jul 2022 16:05:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236589AbiGYUF0 (ORCPT ); Mon, 25 Jul 2022 16:05:26 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 628996385; Mon, 25 Jul 2022 13:05:25 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id tk8so22520491ejc.7; Mon, 25 Jul 2022 13:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IjUjwK3ElFJ8pxv20zoLj+tD6iYdFeeNew4jTmYt/44=; b=cGE6CEk0QSSPB6KPoo76GR4W7rfZkQSW0l/s7lLWDsVAdi0RWDDuAEIm4mPv3Y2vla E9jWTsprUvs7mj3NAZ750HA+h/nDEP0DrHfJKB0kA3Y8aihP6aqn2H9bd2bSYcD4HZLy yruYZcVrm1DtqeIbLOuyj1SLZ9Wgv8ZbPsr9CQyd2skE6PYlEljVmOQuB/H/a2xxcXaE BcVqzg+k6wTU9iZY8D47ZYNT+v7XTYF/kqzNcQEMVyruPFbqhRuWOxOo84f4OzrWUGVi vGmkQy/6ERNzaf+M9TgdJMTsecGebht2h/HKLD8Syb2inviIX+JAs0DJ8Ld8+fheTFMp J5Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IjUjwK3ElFJ8pxv20zoLj+tD6iYdFeeNew4jTmYt/44=; b=D3LOlaCHyUK6ltE55+9Pz9OuBz23Yty+GdBlBf+TvPjJq/Kn98LkSWRBb7fZJEjPrH NNa09fONkVBhOt3oE1HGnZSbcj1GBpiSxvme7fSVjnHkInnUEpb7OLa4BcqRjGnIFMzZ 5iRtqyoE5rtvNi0mubnj5mtsqtILvFMH4lzEprVPEF5Jv11CofVRoXyQ82rLtv+2oxUV PJwwY4IPSYYwMYMjPTkbsxaJWy5408gtyKOgYUwvar3pH8gGvvh2cE21zSpINlPUnP9m COpWBs704EVsIieoE+bkoZvs/ULfwTYwgJuUbtiGaQQjNyfKP4gO1NoEfYBcQ1grUPpT wHPA== X-Gm-Message-State: AJIora9xDwY/2/b2BXFkHWcUjYrjenfJ0Aik1xD9wXyw4uSEgbVUXD7k BJ+Vq0nre+16mXRsl5oCQjZejeM4xGeojElsOjM= X-Received: by 2002:a17:907:1c8d:b0:6f2:eb2:1cd6 with SMTP id nb13-20020a1709071c8d00b006f20eb21cd6mr11153522ejc.568.1658779523752; Mon, 25 Jul 2022 13:05:23 -0700 (PDT) MIME-Version: 1.0 References: <20220721073909.23318-1-srinivas.neeli@xilinx.com> In-Reply-To: From: Andy Shevchenko Date: Mon, 25 Jul 2022 22:04:47 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-xilinx: Fix integer overflow To: Bartosz Golaszewski Cc: Srinivas Neeli , Linus Walleij , Michal Simek , neelisrinivas18@gmail.com, Shubhrajyoti Datta , srinivas.neeli@amd.com, Srinivas Goud , "open list:GPIO SUBSYSTEM" , Linux ARM , Linux Kernel Mailing List , git Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 22, 2022 at 9:19 AM Bartosz Golaszewski wrote: > On Thu, Jul 21, 2022 at 9:39 AM Srinivas Neeli > wrote: > > > > Current implementation is not able to configure more than 32 pins > > due to incorrect data type. So type casting with unsigned long > > to avoid it. > > Fixes: 02b3f84d9080 ("xilinx: Switch to use bitmap APIs") It doesn't fix anything, I already reject one such "fix" during development of this patch. Thanks! ... > > @@ -99,7 +99,7 @@ static inline void xgpio_set_value32(unsigned long *map, int bit, u32 v) > > const unsigned long offset = (bit % BITS_PER_LONG) & BIT(5); > > > > map[index] &= ~(0xFFFFFFFFul << offset); > > - map[index] |= v << offset; > > + map[index] |= (unsigned long)v << offset; > > } > Applied, thanks! False positive. -- With Best Regards, Andy Shevchenko