Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2022694pxu; Sun, 13 Dec 2020 10:53:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJyaAN34vGgWSV0Y9HEPMMUK6bUbXNzZp7geeqVjlETQy11Hx+4VBMcYsnUGxvCLL5wVXmz+ X-Received: by 2002:a17:906:74d9:: with SMTP id z25mr2024007ejl.217.1607885616563; Sun, 13 Dec 2020 10:53:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607885616; cv=none; d=google.com; s=arc-20160816; b=ksr/OWNy63Hx0C7Xs35EV0kBB4p8X5PPGMVAs1HtFkENN8YLbG1n5HP+Ce082p1bQv JUSJkQOWg7Ci3iq0r4MdFRkHsrSvgMQ1+4O3x0W+XZ/rYgLQS0GhcFSvI9oBsT3j0J2x F5o/xfwW73tym6M7dgpDOLN7wteoQB0QvmkKKNsDdtY6GMe2htaG0KON1S7OVnnETryx lhyIIc/8/YuRlOfaeqSz/UH7HSFRRZPuAz9dyUs4qijLobZRrffXXuNIbzMpKUKA9Bma 3TpnLmzYyakED0qMR7LTTOWLafo/0V/jvIjGI8tI2wm/YMlVoqKYa7gH5vaUHa/8LBVc ySZg== 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=3GVFJG5+b4wwaYZGJY5Q+Ty6yteB44I1X0LEyJpOD4Q=; b=vtgHD7irw3KXonZhvzGFKpjb0L57i/twxUZlbeLQIo9Vt37XM5//uQheNBOMmlrtil 4ghv2gNQ6UCY0SpzJyoLRDXTpMTN8MdrVPetkCHgbYFyf2pSf6LD18XKqXNdy0SsPLpZ z4xkO6c6ZhT5tBJNlvoW9/fviK4tovnElCKmU2ytTrqYgT6C+L/Ss42fLjqgMp8PAk9+ QlvkoAWeozmXWxi1tPev7VzCExUR9+I0nQXAzyDSFn/8MR9vVLYes5jE0wsfOID/mm8L vyMxH+KI1OJxBTOlXiW8hpUqKnUUMxJHQO4TqFOwty4IckE/OOWtX20NxF+zcuWeXtof CSuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GQo8nLjw; 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 p1si7997744ejf.418.2020.12.13.10.53.14; Sun, 13 Dec 2020 10:53:36 -0800 (PST) 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=GQo8nLjw; 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 S2405248AbgLMO4y (ORCPT + 99 others); Sun, 13 Dec 2020 09:56:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729813AbgLMO4x (ORCPT ); Sun, 13 Dec 2020 09:56:53 -0500 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FB8FC0613CF; Sun, 13 Dec 2020 06:56:13 -0800 (PST) Received: by mail-pf1-x443.google.com with SMTP id m6so653439pfm.6; Sun, 13 Dec 2020 06:56:13 -0800 (PST) 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=3GVFJG5+b4wwaYZGJY5Q+Ty6yteB44I1X0LEyJpOD4Q=; b=GQo8nLjwy/A+Xg4osxyLYZrO41bSCW7aCe+uxkuHo9PGo+M0tWYbKc6bxIYPizyS7J juIeeq/7CO8m/xfEpcWNZz39mf5LauZ2R3bAxoGjyyrdpVA4rSEcYEpU/JdfDwP/1G+k KY2595tBSlNf2HLzMdrabbvmr0S4Qalr/IjpBZVlDtpMWbSXu3vC5wFzOaMWgXY8gacy PJriOKpHfdn3eLCHFLgIIiZzuw2TIi1bjREXPFIvRsV2yDY888gAlfZok/r5diHJ2r78 SStpmIAx39oRh98debp8Qce656veGXmBj8zjOM8klMCHFLiCDgXoja8XHicnrA3Uk5fr Hpfw== 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=3GVFJG5+b4wwaYZGJY5Q+Ty6yteB44I1X0LEyJpOD4Q=; b=cIc8vZeMEZVNRrg/jLG/KexPxo5ZFIQjsTcQGHbUhJPQmi2RUrhxsAJB5xqCk5lbHc pnd+QsbS87juUscZQshljBksqRj2HIf4tTpw/53rdkxbveNnm8zW2jKhcy7UHd2K4iSq hSsNy9J8XtMhOm7GYNCwQhUB1ft4nBtD2WVPSMX1dcWZEhFnh6NWOdq8I0GCUNFEbIQw qEeDMMvBvbFqg9RErYytlhWc/UUc/XEq5OOY6vAM1V+KWJX7nEMSa/re9j4KJxW+uuJL j0hyR3jq2K4o0DII0zkxtvOCgE/4xrVhIIbXPnxPzvUKbDL+ikTBibMxe2T5A4sW/hWF YN3w== X-Gm-Message-State: AOAM532JDn9fi0+527gu4/GcB61wpjzV5WI7pZjGfW7AFy/Enw9heJsi /YSUhO9weiaHe7Go5xjtx1cktiIPBoOWHo7Id0A= X-Received: by 2002:a62:445:0:b029:19c:162b:bbef with SMTP id 66-20020a6204450000b029019c162bbbefmr20182418pfe.40.1607871372903; Sun, 13 Dec 2020 06:56:12 -0800 (PST) MIME-Version: 1.0 References: <20268bfeb500ad8819e3a11aa1bea27eade4fd39.1607765147.git.syednwaris@gmail.com> In-Reply-To: <20268bfeb500ad8819e3a11aa1bea27eade4fd39.1607765147.git.syednwaris@gmail.com> From: Andy Shevchenko Date: Sun, 13 Dec 2020 16:55:56 +0200 Message-ID: Subject: Re: [PATCH v2 1/2] bitmap: Modify bitmap_set_value() to check bitmap length To: Syed Nayyar Waris Cc: Linus Walleij , Andrew Morton , Andy Shevchenko , William Breathitt Gray , Michal Simek , Arnd Bergmann , Robert Richter , Bartosz Golaszewski , Masahiro Yamada , "Zhang, Rui" , Daniel Lezcano , Amit Kucheria , Linux-Arch , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , linux-arm Mailing List , Linux PM Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 13, 2020 at 4:24 PM Syed Nayyar Waris wrote: > > Add explicit check to see if the value being written into the bitmap > does not fall outside the bitmap. > The situation that it is falling outside would never be possible in the > code because the boundaries are required to be correct before the > function is called. The responsibility is on the caller for ensuring the > boundaries are correct. > The code change is simply to silence the GCC warning messages > because GCC is not aware that the boundaries have already been checked. > As such, we're better off using __builtin_unreachable() here because we > can avoid the latency of the conditional check entirely. > > Cc: Arnd Bergmann > Signed-off-by: Syed Nayyar Waris > Acked-by: William Breathitt Gray > > lib/test_bitmap.c: Modify for_each_set_clump test > > Modify the test where bitmap_set_value() is called. bitmap_set_value() > now takes an extra bitmap-width as second argument and the width of > value is now present as the fourth argument. > > Signed-off-by: Syed Nayyar Waris > > gpio: xilinx: Modify bitmap_set_value() calls > > Modify the bitmap_set_value() calls. bitmap_set_value() > now takes an extra bitmap width as second argument and the width of > value is now present as the fourth argument. > > Cc: Michal Simek > Signed-off-by: Syed Nayyar Waris Commit message here definitely needs more work. First of all, it's now quite awkward to see this squashed stuff like this. Second, it misses the warning examples it's talking about. Third, it repeats some tags. Fourth, it misses the Fixes tag. Please, redone it correctly (one commit message with clear purpose and example of warnings followed by Fixes tag) and resend a v3. You may mention in the cover letter that this is squashed of three patches from v1 (and give a link to lore.kernel.org). -- With Best Regards, Andy Shevchenko