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=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 9C04CC433B4 for ; Thu, 1 Apr 2021 18:53:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6DE0B61007 for ; Thu, 1 Apr 2021 18:53:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236102AbhDASxi (ORCPT ); Thu, 1 Apr 2021 14:53:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240508AbhDASvo (ORCPT ); Thu, 1 Apr 2021 14:51:44 -0400 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66509C061793; Thu, 1 Apr 2021 10:50:31 -0700 (PDT) Received: by mail-il1-x12f.google.com with SMTP id h7so2733823ilj.8; Thu, 01 Apr 2021 10:50:31 -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=+XaU3R90qixaVV7aW+rUvI7mZW0sgqPkaDVLLZSANpk=; b=PAOXjaNp3KR9wkaqwzGajUV+bY15zWzlA+x/vHCeUTnxF2zu1Fe2viAmSmIB7UJ3km c3MirZ6IcUQH/AU93wLX+XRldUcJznMOZksUvqClnSPh2zMf7QzNRNen5iAhTA2iAvQx +uCXc64hqKPVmXXWLUZx7NNiOkaaO6LuB1AHrvI1qB4c2wIZbXLt8BWASpzpQod59IWQ UPMMUaMA5OkGaeCztLQukKuWJL2sdH7uijreieUDBAu+O8aStfDW9wLyJFDLaefvLL96 kEH1/vjzh2KmRxFH52PKsfxCeij4a6x/bbRWimLfVxFmdPlXDlGRdSxbrN9MJY1v4waV mPWA== 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=+XaU3R90qixaVV7aW+rUvI7mZW0sgqPkaDVLLZSANpk=; b=gPzNhUnFOvuG9NaoEb98icE06z27rBgw+jNI6Qq2o5aTbHM5+BD420OdNVQ2pdVRal asauFsGuz5nRZYSv4Op8wCydxezz4ttsHRZdCeNYZ4i7mOQNkNRhIPgPAytI7cEqG+Ug RgRY76TGoZLxC+VC5srVyfpJkHQA1FKChfmdK6uw2vxqPrFlK6TodFFGPayVdbgDcGnj zdBlEAiiJLsOu5kuBG4LEOqL3elqJvyOcVRV/XZcXWdTjNdna31DnG2MKvtm1FHA4fs5 Cm33wygJhZJ6Q851knxCwpxsdyDqwpd9SEkKlQjQePbKpTd+HgQUK6szmsH45f7D2FLa U7sg== X-Gm-Message-State: AOAM533a4knUpQdDGqtlPf9adG7nhxhrydx602gnaMENSZXOMrHuJZ3R WIn+45a6nPLZJ4iHNb1TXzJ4rIYUmexkiJHpOho= X-Google-Smtp-Source: ABdhPJypdKxpeEkzgLCokUxyMCMz480lSKKdcgSUnSJMv1uQm0VHIbMAqvXRye1H8rAFcLAtk2dSHPm1P2RfBItEowg= X-Received: by 2002:a05:6e02:8:: with SMTP id h8mr7415793ilr.164.1617299430937; Thu, 01 Apr 2021 10:50:30 -0700 (PDT) MIME-Version: 1.0 References: <4c259d34b5943bf384fd3cb0d98eccf798a34f0f.1615038553.git.syednwaris@gmail.com> In-Reply-To: From: Syed Nayyar Waris Date: Thu, 1 Apr 2021 23:20:19 +0530 Message-ID: Subject: Re: [PATCH v3 3/3] gpio: xilinx: Utilize generic bitmap_get_value and _set_value To: Andy Shevchenko Cc: William Breathitt Gray , Bartosz Golaszewski , Andy Shevchenko , Michal Simek , Arnd Bergmann , Robert Richter , Linus Walleij , Masahiro Yamada , Andrew Morton , "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 Sat, Mar 27, 2021 at 10:05 PM Andy Shevchenko wrote: > > On Sat, Mar 27, 2021 at 2:02 PM William Breathitt Gray > wrote: > > On Sat, Mar 27, 2021 at 09:29:26AM +0200, Andy Shevchenko wrote: > > > On Saturday, March 27, 2021, Syed Nayyar Waris wrote: > > > > On Fri, Mar 26, 2021 at 11:32 PM Andy Shevchenko > > > > wrote: > > > > > On Sat, Mar 6, 2021 at 4:08 PM Syed Nayyar Waris > > > > wrote: > > > > > > > > > > > + bitmap_set_value(old, 64, state[0], 32, 0); > > > > > > + bitmap_set_value(old, 64, state[1], 32, 32); > > > > > > > > > > Isn't it effectively bitnap_from_arr32() ? > > > > > > > > > > > + bitmap_set_value(new, 64, state[0], 32, 0); > > > > > > + bitmap_set_value(new, 64, state[1], 32, 32); > > > > > > > > > > Ditto. > > > > > With bitmap_set_value() we are also specifying the offset (or start) > > > > position too. so that the remainder of the array remains unaffected. I > > > > think it would not be feasible to use bitmap_from/to_arr32() here. > > > > > > > > > You have hard coded start and nbits parameters to 32. How is it not the > > > same? > > > > Would these four lines become something like this: > > > > bitmap_from_arr32(old, state, 64); > > ... > > bitmap_from_arr32(new, state, 64); > > This is my understanding, but I might miss something. I mean driver > specifics that make my proposal incorrect. > > -- > With Best Regards, > Andy Shevchenko I initially (incorrectly) thought that all of the bitmap_set_value() statements have to be replaced. But now I realised, only those specific bitmap_set_value() calls containing 32 bits width have to replaced. I will incorporate the above review comments in my next v4 submission. Regards Syed Nayyar Waris 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=-0.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 C9302C433B4 for ; Thu, 1 Apr 2021 17:51:54 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 46BC860FF3 for ; Thu, 1 Apr 2021 17:51:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 46BC860FF3 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc: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=lOvqJeRuo9zK+x9Br4v1JH75iYJ2bAOI6fhTxKE2XBI=; b=nv9QBTho5M9fpsF6jFYFGTlXd trbc1oYlrTzwhAhmvtLNE5YCigth8RSbMtvFwWAd9hqxh/x2uvK5vhxwW2f5mD1fEcHeEElax3rKW DLjFr+UZ4OkF0mTOxGpbqT0aJ/DPW7qf89UIPshs6NbxuQ4glabwu7tKFeo5CO1KTXnT6RTxe5OyK jkD8zgnRm3JZHKLgeHCgTF3DBkz0g1z5CDqJ/0XJCiY6D5if8xqPYfLVMe+skvMTWZJn4TZb5NkpC grxc+Rav/IMM5Htwn3CLJqKEaKb5o/+ir4YmAOqIX6veFYPb525r8L2Jg6pg8U1zDhpLu4HFOgpYJ j6lDuXg8g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lS1Sm-00Aaji-Gp; Thu, 01 Apr 2021 17:50:36 +0000 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lS1Si-00Aaie-B1 for linux-arm-kernel@lists.infradead.org; Thu, 01 Apr 2021 17:50:34 +0000 Received: by mail-il1-x12c.google.com with SMTP id 19so2766949ilj.2 for ; Thu, 01 Apr 2021 10:50:31 -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=+XaU3R90qixaVV7aW+rUvI7mZW0sgqPkaDVLLZSANpk=; b=PAOXjaNp3KR9wkaqwzGajUV+bY15zWzlA+x/vHCeUTnxF2zu1Fe2viAmSmIB7UJ3km c3MirZ6IcUQH/AU93wLX+XRldUcJznMOZksUvqClnSPh2zMf7QzNRNen5iAhTA2iAvQx +uCXc64hqKPVmXXWLUZx7NNiOkaaO6LuB1AHrvI1qB4c2wIZbXLt8BWASpzpQod59IWQ UPMMUaMA5OkGaeCztLQukKuWJL2sdH7uijreieUDBAu+O8aStfDW9wLyJFDLaefvLL96 kEH1/vjzh2KmRxFH52PKsfxCeij4a6x/bbRWimLfVxFmdPlXDlGRdSxbrN9MJY1v4waV mPWA== 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=+XaU3R90qixaVV7aW+rUvI7mZW0sgqPkaDVLLZSANpk=; b=trHIGAe3upHaiXGx8RQve7d4luvQjBYVOxt2R+O0R2liyowC1RfGlDcxebhcPWlFo1 L82Wh0cZUBPpvFPwunnpxva8l7i6gnnFyGVb/vbRCgG9UNGqT6QbRnyqnyXwLO3wfN5J M4lIa6AR0mHfXqTtoAbDsXEXT14HwDZ+e6r73lsnIZR2sbU6daCnysT9nu5j7fK98AAi U8NBxKizUyy9C+3UirbKnqMAmtqipioseCz8ALIPEVz+0Voyo4ypz6Sxbuc7LAA7TnDZ MV5scFD1Uiy9U8Gz5ZX6v7gB7MT2sGGvC78PrvnXam8aaj+HANwvv3PyA5yFj4q7eFMQ TAVw== X-Gm-Message-State: AOAM531a0pE8Ck2RnjOLApOHKdnj4a3Dhg2r/RQM6ozEbUD7pe1N1DMw pHHYoWW2ArirV+Ox9ZoocVj1HE9AzGFh6wf4Wgs= X-Google-Smtp-Source: ABdhPJypdKxpeEkzgLCokUxyMCMz480lSKKdcgSUnSJMv1uQm0VHIbMAqvXRye1H8rAFcLAtk2dSHPm1P2RfBItEowg= X-Received: by 2002:a05:6e02:8:: with SMTP id h8mr7415793ilr.164.1617299430937; Thu, 01 Apr 2021 10:50:30 -0700 (PDT) MIME-Version: 1.0 References: <4c259d34b5943bf384fd3cb0d98eccf798a34f0f.1615038553.git.syednwaris@gmail.com> In-Reply-To: From: Syed Nayyar Waris Date: Thu, 1 Apr 2021 23:20:19 +0530 Message-ID: Subject: Re: [PATCH v3 3/3] gpio: xilinx: Utilize generic bitmap_get_value and _set_value To: Andy Shevchenko Cc: William Breathitt Gray , Bartosz Golaszewski , Andy Shevchenko , Michal Simek , Arnd Bergmann , Robert Richter , Linus Walleij , Masahiro Yamada , Andrew Morton , "Zhang, Rui" , Daniel Lezcano , Amit Kucheria , Linux-Arch , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , linux-arm Mailing List , Linux PM X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210401_185032_483587_F021B5D2 X-CRM114-Status: GOOD ( 19.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Sat, Mar 27, 2021 at 10:05 PM Andy Shevchenko wrote: > > On Sat, Mar 27, 2021 at 2:02 PM William Breathitt Gray > wrote: > > On Sat, Mar 27, 2021 at 09:29:26AM +0200, Andy Shevchenko wrote: > > > On Saturday, March 27, 2021, Syed Nayyar Waris wrote: > > > > On Fri, Mar 26, 2021 at 11:32 PM Andy Shevchenko > > > > wrote: > > > > > On Sat, Mar 6, 2021 at 4:08 PM Syed Nayyar Waris > > > > wrote: > > > > > > > > > > > + bitmap_set_value(old, 64, state[0], 32, 0); > > > > > > + bitmap_set_value(old, 64, state[1], 32, 32); > > > > > > > > > > Isn't it effectively bitnap_from_arr32() ? > > > > > > > > > > > + bitmap_set_value(new, 64, state[0], 32, 0); > > > > > > + bitmap_set_value(new, 64, state[1], 32, 32); > > > > > > > > > > Ditto. > > > > > With bitmap_set_value() we are also specifying the offset (or start) > > > > position too. so that the remainder of the array remains unaffected. I > > > > think it would not be feasible to use bitmap_from/to_arr32() here. > > > > > > > > > You have hard coded start and nbits parameters to 32. How is it not the > > > same? > > > > Would these four lines become something like this: > > > > bitmap_from_arr32(old, state, 64); > > ... > > bitmap_from_arr32(new, state, 64); > > This is my understanding, but I might miss something. I mean driver > specifics that make my proposal incorrect. > > -- > With Best Regards, > Andy Shevchenko I initially (incorrectly) thought that all of the bitmap_set_value() statements have to be replaced. But now I realised, only those specific bitmap_set_value() calls containing 32 bits width have to replaced. I will incorporate the above review comments in my next v4 submission. Regards Syed Nayyar Waris _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel