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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 BF44EC433C1 for ; Mon, 29 Mar 2021 23:05:46 +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 E6C8861935 for ; Mon, 29 Mar 2021 23:05:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6C8861935 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.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:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yiRPGmXS+0JEEzbpj8PB5yei7Gi3y/kaSRhsv1L+sPE=; b=m0iW8lqvOevA2P/P0gQF1gT4b ku4QIieM0UdTqaitSMzfFTGlfYJnVu1qnYh8x9n9ckNz+4kUOwtSfhfMmsbomohYGvBZs6GFH1XvD UYpu7werjeB9xbF4VSZQKORyEAz/SHnA+tyrX5Drn4eYlT64b9d52cMeqOUqQWZGWEuu9nCYnjws6 ij6GjtR6dJ0pA+h6CewspQamYWUTxgTsYnpwjKj1JYzeNdgNcwFxvpBNCV2WJgkKues26OTa1jgGG qGXM3UBS5quqaCVAqKpk2YZIbmXQZg7vOae4aI5AOKFhJnTlly75zY/bF1Sus/GqNqEMQFBDGkcX2 yNlhAcW3w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lR0vN-001p41-QC; Mon, 29 Mar 2021 23:03:58 +0000 Received: from mga11.intel.com ([192.55.52.93]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lQtl5-000jX6-Qp for linux-arm-kernel@lists.infradead.org; Mon, 29 Mar 2021 15:24:59 +0000 IronPort-SDR: +GHYdGGq3bfkCGKIyTDwb8dnTfmUZS8LmY5D6ZBzDZAU/MkEmYdDzAOZaR/+0gRtmBzlib+A+5 +fmK8z8SUZqw== X-IronPort-AV: E=McAfee;i="6000,8403,9938"; a="188302932" X-IronPort-AV: E=Sophos;i="5.81,288,1610438400"; d="scan'208";a="188302932" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2021 08:24:43 -0700 IronPort-SDR: 4eVELRd9pZsPnZNimTuGuxMOd9iNPeuOxgA4FtQTcj7L3pfqpUVHF2LA55K8olLS3KTzG9awJ8 lLSCJwsi/2BA== X-IronPort-AV: E=Sophos;i="5.81,288,1610438400"; d="scan'208";a="444813722" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2021 08:24:39 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lQtkq-00H3Y5-8r; Mon, 29 Mar 2021 18:24:36 +0300 Date: Mon, 29 Mar 2021 18:24:36 +0300 From: Andy Shevchenko To: Syed Nayyar Waris 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 Subject: Re: [PATCH v3 3/3] gpio: xilinx: Utilize generic bitmap_get_value and _set_value Message-ID: References: <4c259d34b5943bf384fd3cb0d98eccf798a34f0f.1615038553.git.syednwaris@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4c259d34b5943bf384fd3cb0d98eccf798a34f0f.1615038553.git.syednwaris@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210329_162456_499005_D637BE49 X-CRM114-Status: GOOD ( 13.12 ) 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel