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.7 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, 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 77968C43460 for ; Thu, 1 Apr 2021 18:52:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5970261151 for ; Thu, 1 Apr 2021 18:52:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237185AbhDASwZ (ORCPT ); Thu, 1 Apr 2021 14:52:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236560AbhDASqn (ORCPT ); Thu, 1 Apr 2021 14:46:43 -0400 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2CCDC03117E; Thu, 1 Apr 2021 10:47:26 -0700 (PDT) Received: by mail-io1-xd33.google.com with SMTP id r193so83139ior.9; Thu, 01 Apr 2021 10:47:26 -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=3ABGeqwVjSflF2v2NwkfGGEvt0FHlPNp2jDD7Wn08AU=; b=dbI+llyCF1qsXCU+57jJILTQijq3LOuUqHcBa+PDsJZd+qYeLYTTrxhGY6p/hL6FS9 wAJbCLjYGbywRHj93PpB4vFmO+m5MtJRbkLixlRiIF+GJFoT8DOzAUMnhjB9PD4sKCXc s0TXQ4V052qyHV9jW8fqVjxsCpESkWxaV/4bHZdtuPi5sH7i2s7q1qWvS6T9+oRlXDEU dzx7L1iiHq1TQGJzzO/cUXcOAYWh+tNNocM46kBm3uBWldpm2KKOlGOqM/iQ3yKMAqJH oTNyJVPgFuvSz2K5pLp5cRqdr4eQ4AChyDiR/J92aOEoJ8OKbqahX9atC34oh+XoDhT1 7J+g== 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=3ABGeqwVjSflF2v2NwkfGGEvt0FHlPNp2jDD7Wn08AU=; b=Nd/8EpV3kHK/YrFjULvnc4XYxnHtYdqs8Y6LT66j+gk5hgcJHK/00FwlWKaQT8besN gekkQSY8gqkE13mceOetcJbzjqZfTLr9S4yVZMGmCRv/vi2JlX+iFNo/3k/2nz+V32yM BDNZhzl//+w0Q6Y9l9T4jpRE6sEDpO+unCV4xVP7SVY4kqjnxhwsMqPk/1G8+kBDd2zo aoSxxL2bXEe/x6kPnQ0eArDCNFD7xgYMGVim49NAHIobjHWnvF/989gN3V8OxtRwPxv8 AHP1HHkamDC4vOzsCJiUEwstEQEPqzEljmbWl56xlclRzzVV2MVnbmbwYRbcl9pgs2hs mcfA== X-Gm-Message-State: AOAM531CT3hpTnIz+wS6Hso2/SH4YM6ic8edcX2hI0XbMfgssom+znLd lxuLl2IY2tLW7J94iw3Lm2n3VV0KjRGzav41q00= X-Google-Smtp-Source: ABdhPJygL2fEG9ynxvRZd0xI2Sl72GRxKCKZUvZoJJ82A3PudPrn5eaoXRizLdc40BLb9nIB+DYon8bznwjnQa0X3Ew= X-Received: by 2002:a05:6602:21cd:: with SMTP id c13mr7436621ioc.44.1617299246197; Thu, 01 Apr 2021 10:47:26 -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:17:14 +0530 Message-ID: Subject: Re: [PATCH v3 3/3] gpio: xilinx: Utilize generic bitmap_get_value and _set_value To: Andy Shevchenko Cc: bgolaszewski@baylibre.com, vilhelm.gray@gmail.com, michal.simek@xilinx.com, arnd@arndb.de, rrichter@marvell.com, linus.walleij@linaro.org, yamada.masahiro@socionext.com, akpm@linux-foundation.org, rui.zhang@intel.com, daniel.lezcano@linaro.org, amit.kucheria@verdurent.com, linux-arch@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Mon, Mar 29, 2021 at 8:54 PM Andy Shevchenko wrote: > > On Sat, Mar 06, 2021 at 07:36:30PM +0530, Syed Nayyar Waris wrote: > > This patch reimplements the xgpio_set_multiple() function in > > drivers/gpio/gpio-xilinx.c to use the new generic functions: > > bitmap_get_value() and bitmap_set_value(). The code is now simpler > > to read and understand. Moreover, instead of looping for each bit > > in xgpio_set_multiple() function, now we can check each channel at > > a time and save cycles. > > ... > > > + u32 *const state = chip->gpio_state; > > Looking at this... What's the point of the const here? > > Am I right that this tells: pointer is a const, while the data underneath > can be modified? > > > + unsigned int *const width = chip->gpio_width; > > Ditto. > > Putting const:s here and there for sake of the const is not good practice. > It makes code harder to read. > > -- > With Best Regards, > Andy Shevchenko > Okay. I will incorporate your comments in my next submission. Thank You. 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 9829EC433ED for ; Thu, 1 Apr 2021 17:48:49 +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 361F360234 for ; Thu, 1 Apr 2021 17:48:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 361F360234 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=c3Ze3ftAK9gAVfUh4rqezq4yobIua+bbFV6yCV1AgOQ=; b=kCXW62srrKhK26QaZ94Zev1rH 8W1XYX36eexTtjxG9InCRirtoKg68XEgy4HqxwLhE4REW9NesnP1las1G/IsuCMGGrUGYJs+w1geF 7Hkxl8l/hoQWUpfyzIWcbSASz40ARIYSoGhaku75c0kYbohH4cwp6dv3Avc9i4Fy6Qqak43LFE/bh 7isw7CBQCTgXaOAlkB3LfLs4g7t6ocgg02mfUAhSAnBvcUafAUfORJoKREHECJwPI0YUvJFaaSWeh 9Zp6McyPEBQI1U9DDz6YSb01DRGIRTsemPD8ymOaxZGS1ryh3YkNo7lxHUgZPT7jemD1dQG9kePIr qSSejDPPQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lS1Pn-00AaJK-0l; Thu, 01 Apr 2021 17:47:31 +0000 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lS1Pj-00AaIk-Bv for linux-arm-kernel@lists.infradead.org; Thu, 01 Apr 2021 17:47:29 +0000 Received: by mail-io1-xd2e.google.com with SMTP id z3so276454ioc.8 for ; Thu, 01 Apr 2021 10:47:27 -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=3ABGeqwVjSflF2v2NwkfGGEvt0FHlPNp2jDD7Wn08AU=; b=dbI+llyCF1qsXCU+57jJILTQijq3LOuUqHcBa+PDsJZd+qYeLYTTrxhGY6p/hL6FS9 wAJbCLjYGbywRHj93PpB4vFmO+m5MtJRbkLixlRiIF+GJFoT8DOzAUMnhjB9PD4sKCXc s0TXQ4V052qyHV9jW8fqVjxsCpESkWxaV/4bHZdtuPi5sH7i2s7q1qWvS6T9+oRlXDEU dzx7L1iiHq1TQGJzzO/cUXcOAYWh+tNNocM46kBm3uBWldpm2KKOlGOqM/iQ3yKMAqJH oTNyJVPgFuvSz2K5pLp5cRqdr4eQ4AChyDiR/J92aOEoJ8OKbqahX9atC34oh+XoDhT1 7J+g== 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=3ABGeqwVjSflF2v2NwkfGGEvt0FHlPNp2jDD7Wn08AU=; b=faGganvzX65JXoPPUy+183EBRhtvt7VhkoTxYndZA5z2VPVnQ/yZ4Udgtb/zRAdSCW ViwDuFviwrKJnOgfa3f25BXF5Ca8fyOywyEj23ArvFtoZv5W4lGzV39XwlqheWB0WwMQ 8Q0XpVYmoaOERu4j8tB/veVcpXhaf8Ct9zY3lVQAaUNPUc3LScBnDhiSFYyxxaeaEJkN vt5NUQGqAhQlh4IfQ0bqnNKhX3ZRJMXTRmN8uhhbvL35i3gDGV6HUUjejPf8+olAP3Ep rcXYBn4CjsJ3BjudsfCOuogVAzcQh74B03P93iekdDoExE2o6I9Hs0bLqeZlWQ5bIRN/ 5iGw== X-Gm-Message-State: AOAM533yvmUEes9wArlt5L8JvNCoKqsyZEcWPRWQyqQ7FmvWvvjfwsfB z3BCztdJIMRU/ZSeoXQJ/E4jKNM7vHkY95YnDQA= X-Google-Smtp-Source: ABdhPJygL2fEG9ynxvRZd0xI2Sl72GRxKCKZUvZoJJ82A3PudPrn5eaoXRizLdc40BLb9nIB+DYon8bznwjnQa0X3Ew= X-Received: by 2002:a05:6602:21cd:: with SMTP id c13mr7436621ioc.44.1617299246197; Thu, 01 Apr 2021 10:47:26 -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:17:14 +0530 Message-ID: Subject: Re: [PATCH v3 3/3] gpio: xilinx: Utilize generic bitmap_get_value and _set_value To: Andy Shevchenko Cc: bgolaszewski@baylibre.com, vilhelm.gray@gmail.com, michal.simek@xilinx.com, arnd@arndb.de, rrichter@marvell.com, linus.walleij@linaro.org, yamada.masahiro@socionext.com, akpm@linux-foundation.org, rui.zhang@intel.com, daniel.lezcano@linaro.org, amit.kucheria@verdurent.com, linux-arch@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210401_184727_543867_E80F1BD2 X-CRM114-Status: GOOD ( 18.18 ) 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 Mon, Mar 29, 2021 at 8:54 PM Andy Shevchenko wrote: > > On Sat, Mar 06, 2021 at 07:36:30PM +0530, Syed Nayyar Waris wrote: > > This patch reimplements the xgpio_set_multiple() function in > > drivers/gpio/gpio-xilinx.c to use the new generic functions: > > bitmap_get_value() and bitmap_set_value(). The code is now simpler > > to read and understand. Moreover, instead of looping for each bit > > in xgpio_set_multiple() function, now we can check each channel at > > a time and save cycles. > > ... > > > + u32 *const state = chip->gpio_state; > > Looking at this... What's the point of the const here? > > Am I right that this tells: pointer is a const, while the data underneath > can be modified? > > > + unsigned int *const width = chip->gpio_width; > > Ditto. > > Putting const:s here and there for sake of the const is not good practice. > It makes code harder to read. > > -- > With Best Regards, > Andy Shevchenko > Okay. I will incorporate your comments in my next submission. Thank You. Regards Syed Nayyar Waris _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel