From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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=-7.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 7C5AFC433FE for ; Sun, 13 Dec 2020 14:56:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3774E23137 for ; Sun, 13 Dec 2020 14:56:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391778AbgLMO4x (ORCPT ); Sun, 13 Dec 2020 09:56:53 -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-Google-Smtp-Source: ABdhPJyHCjy5gjCeZf12NOQT17rVqbmsRh+vBivyM/+Ci93YR1wXBbG3c7sP9pW22RPlYkg5PP+otes6jmJuO6o0IMM= 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-gpio@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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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=-5.7 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,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 387E7C433FE for ; Sun, 13 Dec 2020 14:57:54 +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 D2F3723137 for ; Sun, 13 Dec 2020 14:57:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2F3723137 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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+4qB9NK4TMbOuVthHckDzn2s91DPV1OFK/yv+hBARn0=; b=btApJgdjySxBFt5bbxIc+jH/1 BEZ+oBA9lC3Oa79YsGHdKMHD6EO74Iz/Nnp7MEJv0ZVbPAsQ0gOUIGizn3lLxh6As/ulrr97b4Mao Rs3Qm+4rH+3rvsiyuPMJwRzhRp5DpyH2yOkLB53PuL2qRUtDTWbeMiyPRCG/xKaD+nZ4uaKhJiTY6 jIY62hywTlQvcFRhXwxF60nrV+ArZnvdoEvJzZlHSIYUOSKkqutBnUDlwNKjZwjhYrCle7m8FPUF9 dYl5ODwz30uDRhwwhWihj48CS1GQ/h8rd7V7V7JGR0KRR/egemv0BGUt2UhU4JfDNAQN8ow3SVjEq 6CJdQ8GaA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1koSnM-0003gw-DY; Sun, 13 Dec 2020 14:56:20 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1koSnJ-0003gZ-Nz for linux-arm-kernel@lists.infradead.org; Sun, 13 Dec 2020 14:56:18 +0000 Received: by mail-pf1-x442.google.com with SMTP id f9so10375022pfc.11 for ; Sun, 13 Dec 2020 06:56:14 -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=E20WDsSzu4ldwnpvp2xR3h8BgJLRM4L3P3SuFmfSuODjM76Z0q9xpIPqJB3xtwiMmW PZo2FOQJn065cqhzz73kOKLZt9FlC4pyrKhy1ui5iOLnM16CZqCfYTRyZwe7V3dMIfDh prqqWDW1aLOhf1EJWn9GJq0/o6iGEgCg82UE67Idw/bX2o0s5dMkBzIqqdqcy8XIEJLI fXKM/HOaocpaxXoldqvABbYF9kcBPwpcZcOVALNEwq3GBsugk1kVbZnv8BaqdeGvzPv8 JfhFry5fQI3DAm2m1on/5ZS7AwfExTzu9Zbw1xklaaqqhk2JMmAalRkE8Xbg7X89z9ts 70vg== X-Gm-Message-State: AOAM5316qfOXKm1t6RxwPkmstoulcGr9QoMSZ9GZS/AQdL6aJoEd+Lkk gAz7I4/2HNWkgUJ9qt09s4GXX6azsCwO7Fy1v2I= X-Google-Smtp-Source: ABdhPJyHCjy5gjCeZf12NOQT17rVqbmsRh+vBivyM/+Ci93YR1wXBbG3c7sP9pW22RPlYkg5PP+otes6jmJuO6o0IMM= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201213_095617_847822_28D25850 X-CRM114-Status: GOOD ( 19.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-Arch , Amit Kucheria , Arnd Bergmann , Masahiro Yamada , Linux Kernel Mailing List , Linus Walleij , Daniel Lezcano , Michal Simek , William Breathitt Gray , Bartosz Golaszewski , Robert Richter , "open list:GPIO SUBSYSTEM" , Linux PM , Andrew Morton , Andy Shevchenko , "Zhang, Rui" , linux-arm Mailing List Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel