Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2204330ybt; Mon, 15 Jun 2020 22:59:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwS/BjMBcY4ku8qpMFsiKpQ/sw/5HPjhmMsjND6Wc1JUI6gNG6lw8NfFVsa4QWTlxOj0XzP X-Received: by 2002:a17:906:4e57:: with SMTP id g23mr1216644ejw.522.1592287196520; Mon, 15 Jun 2020 22:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592287196; cv=none; d=google.com; s=arc-20160816; b=gMFQxmsv340/e74Uibvr2mV/NIQkM4ynS+qAn5PC5NOYtys2u30ovU7HMMKqSuy8tv hkitui8VGRB2LsS0HYVNbGt9xEQ+px17UmwNj2hrXUPhVu/ESl2Zwxh5+uFlgYUVWTII +uemdAWwUanohMoM+OOcdIilYo1MsfmPifOJ/VOVKaewrnElYF3xJw2KlMvzS9nQ0ZnN LbLD+Sy8uHKShEwTIKvg+kceo2eS8EGnnhr2ntsW9QQ2QgS3b7ihEkpHdyW/kEHIHHxS Fn9th1qAz3Kt8/oFxsPNp68uAJkQF4ycmhxxjFld9A37T/H6Y5wpx7j18g6xNsko2sgQ SCCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=jO6HidFD2GZHYEdq4Pf2STG4Y5Qbo03mtR4akQ8KCrc=; b=nb8bcDmALhN2b3M8NNBXHgUagamYxOqD6NRAMg70T6ZPQCgTpjnbrxaQRTHISRcGv/ JSHaZTq/3/nmvZ03vRxl4ILpfmlhzhwxgsvHaHpEtiaMX/Wt6FR1hXDCk0MhqzBrCBbb gm4nv2rUPCoIeTqSfEs+A92hSciBjFEObsZSzi0PpG2C7ydac+YUap7+vDlcYkGvT3fz oB/OcHK1PH1qI7ndFVq+AOk0HgiKGEAi2sYm5Yobx7/6hmx4xAxL4TCrRqcrKxAY+T70 BR3y3TdtJfPYIDLQ3qR27RnVP82IFW1q5u9zeQ0XEjq1AYWGcHFSugGGPMDSdYRM02LG Ewkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XNcJFU+r; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp4si12857608ejc.258.2020.06.15.22.59.33; Mon, 15 Jun 2020 22:59:56 -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=@gmail.com header.s=20161025 header.b=XNcJFU+r; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726940AbgFPF5a (ORCPT + 99 others); Tue, 16 Jun 2020 01:57:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbgFPF5a (ORCPT ); Tue, 16 Jun 2020 01:57:30 -0400 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 268DEC05BD43; Mon, 15 Jun 2020 22:57:30 -0700 (PDT) Received: by mail-il1-x144.google.com with SMTP id l6so1536464ilo.2; Mon, 15 Jun 2020 22:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jO6HidFD2GZHYEdq4Pf2STG4Y5Qbo03mtR4akQ8KCrc=; b=XNcJFU+rZ0+XQJp6ONQ9hU4ZBMCl6KiGYneEjomu+Lm5Sl16WzM00tDZ3f7QKoct40 Z4S778WXwJFLa9FZWahFfpuBaUw6AZD9ZZDt3Kizgl59ImGei18iRi/Xr4RuKc1wqG0x GpnQFApUOn0UBHJMFIRiHODUez3MBBgUiDA2CLc1tkdMnOTA1TQ1ldgaMOtPmfEo9ebS Py94inw3gWE2cFXJlNDTZcBVV/YJ2edW/w2AcuCdCCUSKV834QIWNDh7lg/EBOxCLZDI 0HetA9coL37DNQoYHj4XOSn5NIhP7TwVMt4gHzhE1zZl+OcTDx0gfyQjJ55dlkw0VKzc LFUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jO6HidFD2GZHYEdq4Pf2STG4Y5Qbo03mtR4akQ8KCrc=; b=s6EKW4h5AEkIu1/NmsDJTGgF2YCFsLNFg5NzUgkCfRA8KItf6bLPBA/J9vL8GXZ8gJ 8Gu124TP7yp/CD58kMfm68k0l7ncwY0WlZlNlWZvgB2XCydFb86rUv2ti9+VbWK92QCf i7OquFe0Gi7+PzC4XYH1qKLpYWQH9RogElt0bkkwz0IjVNDglkYUSncpkrrIB0/71i7T SCP5LPVBP4AyZvIH6evTjQUkhsWFg00PiCD1JY1A2x2f1F/2xgtU68ILlkFwjshqwcDI smJ3lm0SiSh5Y4JmBS1bnytqrASwbVRGDz9imKR7z0C3L/VxYWr4jwMkTicK+AxmfzUw g6vg== X-Gm-Message-State: AOAM533rJNwy2Uc1AXhgAcTLZkrhdsKgsSjZDv0KbMxYb9gV54Cm5fCT 2KMTEk/aH98xnGZh2M6yvXLI1s1zB3xiz/NSaEv/DDuE X-Received: by 2002:a92:7309:: with SMTP id o9mr1580810ilc.205.1592287049436; Mon, 15 Jun 2020 22:57:29 -0700 (PDT) MIME-Version: 1.0 References: <46c05c5deeada60a13ee0de83c68583d578f42fd.1592224129.git.syednwaris@gmail.com> <202006160420.iatdr9ab%lkp@intel.com> In-Reply-To: <202006160420.iatdr9ab%lkp@intel.com> From: Syed Nayyar Waris Date: Tue, 16 Jun 2020 11:27:18 +0530 Message-ID: Subject: Re: [PATCH v8 4/4] gpio: xilinx: Utilize for_each_set_clump macro To: kernel test robot Cc: Linus Walleij , Andrew Morton , kbuild-all@lists.01.org, Andy Shevchenko , William Breathitt Gray , Bartosz Golaszewski , Michal Simek , "open list:GPIO SUBSYSTEM" , linux-arm Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 16, 2020 at 1:39 AM kernel test robot wrote: > > Hi Syed, > > Thank you for the patch! Perhaps something to improve: > > [auto build test WARNING on 444fc5cde64330661bf59944c43844e7d4c2ccd8] > > url: https://github.com/0day-ci/linux/commits/Syed-Nayyar-Waris/Introduce-the-for_each_set_clump-macro/20200615-205729 > base: 444fc5cde64330661bf59944c43844e7d4c2ccd8 > config: sparc64-randconfig-s032-20200615 (attached as .config) > compiler: sparc64-linux-gcc (GCC) 9.3.0 > reproduce: > # apt-get install sparse > # sparse version: v0.6.2-rc1-3-g55607964-dirty > # save the attached .config to linux build tree > make W=1 C=1 ARCH=sparc64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > > > sparse warnings: (new ones prefixed by >>) > > >> include/linux/bitmap.h:639:45: sparse: sparse: shift too big (64) for type unsigned long > >> include/linux/bitmap.h:639:45: sparse: sparse: shift too big (64) for type unsigned long > include/linux/bitmap.h:594:63: sparse: sparse: shift too big (64) for type unsigned long > >> include/linux/bitmap.h:639:45: sparse: sparse: shift too big (64) for type unsigned long > >> include/linux/bitmap.h:638:17: sparse: sparse: invalid access past the end of 'old' (8 8) > > vim +639 include/linux/bitmap.h > > 169c474fb22d8a William Breathitt Gray 2019-12-04 613 > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 614 /** > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 615 * bitmap_set_value - set n-bit value within a memory region > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 616 * @map: address to the bitmap memory region > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 617 * @value: value of nbits > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 618 * @start: bit offset of the n-bit value > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 619 * @nbits: size of value in bits > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 620 */ > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 621 static inline void bitmap_set_value(unsigned long *map, > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 622 unsigned long value, > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 623 unsigned long start, unsigned long nbits) > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 624 { > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 625 const size_t index = BIT_WORD(start); > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 626 const unsigned long offset = start % BITS_PER_LONG; > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 627 const unsigned long ceiling = roundup(start + 1, BITS_PER_LONG); > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 628 const unsigned long space = ceiling - start; > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 629 > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 630 value &= GENMASK(nbits - 1, 0); > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 631 > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 632 if (space >= nbits) { > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 633 map[index] &= ~(GENMASK(nbits + offset - 1, offset)); > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 634 map[index] |= value << offset; > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 635 } else { > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 636 map[index] &= ~BITMAP_FIRST_WORD_MASK(start); > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 637 map[index] |= value << offset; > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 @638 map[index + 1] &= ~BITMAP_LAST_WORD_MASK(start + nbits); > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 @639 map[index + 1] |= (value >> space); > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 640 } > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 641 } > 803024b6c8a375 Syed Nayyar Waris 2020-06-15 642 Regarding the compilation warning reported above: "sparse: shift too big (64) for type unsigned long" at line 639 "sparse: invalid access past the end of 'old' (8 8)" at line 638 Kindly refer to the code above, at these line numbers. I am in the process of fixing this warning. But what would be the fix ? At the moment can't think of a code-fix to make the compilation warning disappear (specially at line 639). Can anyone please explain to me the meaning of the compilation warning more deeply? By the way, this warning was not reported in (earlier) v7 of the patchset. Regards Syed Nayyar Waris