Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp202795pxy; Tue, 4 May 2021 23:27:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqWroHJryFt4aEND5vKJkebOsB4N8CQx0IpZ+qHO4mcFTccNAEEqDnqjX69g1SSn6XMZ7a X-Received: by 2002:aa7:8198:0:b029:274:8a92:51b5 with SMTP id g24-20020aa781980000b02902748a9251b5mr27501899pfi.5.1620196047030; Tue, 04 May 2021 23:27:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620196047; cv=none; d=google.com; s=arc-20160816; b=o3GMIWcEiGaaFv6V/bnsEpFxAhMCxiwJHPVmBXelwE4BfAIC46kkMbisZvvMOzWm6S 9cIgMoxJrlP8rCc7wgsS/7L9Q/L/tIwUVVXe58797vNfeb7yUElE7gKB4T1MufCXHeWa pk6zm44RkCMMU8QbM8m2Wzu+YPzXY1hbjYTmRuRqVUbRsStsD9Dy3Yzbctp6HAyoqc1R JLcD59qqgsiZAR5Iyhx8VpHP7QJZZAJvZQjtz0j2I+P2j8jt7TODQ/v9RubzgjDeLfR/ i6zxLb3a+JXA/G8ucR29McCP7BmBg5BVwvjwGI7cIyjAD/F0bScFaKGNvABDL1gxxJan GUqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ztMiZPoUcXfxAPGVoV4PR2Y8132AOXJIKCVxNa7tLog=; b=Z7p0MjCyqC8nJDIIDV2aLMChTPGKLHRSA7+Vewrv8nozVu/SsDI9nP0NHFcPZcTsTQ U9rvPwEV/zizy4V+Tor5NVkZyL3HAHUG23iAmbz2nztYpOwKg2+0iMwBrnOafSpYYkWW D8KWtmkWVZ0LMHYXPu9LJS4uerBu0571bzHe5NwvtfAvY3htvrUIWRHt2/A+ZOs52HJm Ozz7bxBliS9j0ZsMJ5/JDs9p234hFA53mntlDeDaDjPUFsUhLaWG/drjGD2CLhECzD8K 5vrlmlRXlqfZZv4Jtt5MGleAIIsyrrwwx8+FVFZ8v5ZeTM5fClI0U3gA2PWvVHcsJN+S sXwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HbsqixYg; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a133si21045313pfd.294.2021.05.04.23.26.51; Tue, 04 May 2021 23:27:27 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=HbsqixYg; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231734AbhEEFXf (ORCPT + 99 others); Wed, 5 May 2021 01:23:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:39240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231388AbhEEFXe (ORCPT ); Wed, 5 May 2021 01:23:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B4FF361176; Wed, 5 May 2021 05:22:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620192158; bh=bPIeKfd6KZ78X0NtafKS2Ld5eWyAQr/hRA5Y7nqkX5Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HbsqixYgEOIdUWAQfZlPPm6FdNMeb4RmS/3GvhlnqyWw8jqKWmtDhsvXvb9Ag50zs /epJxLlp0YDsliOWhR8/23gNTnrg5B4WP7sHGtEYrtVSC1OnzMzePLB2/KehTQ+vVP euEoqHuiKHUD/U3GHMd0ubofFswfPNPnw+07Ur0MD/WaUF4hVihK3RMBzHC5f0a3+b c3uHJZUt9wPB4R8n6wq/gWQlMPn5dhx76Mjk4nrEj5FnXw55PHDFDnnYEhdTs2t0Ma mIbJvz5snMxmRP9gtHZMlswTmPt56wqx6FGqhpj3nMastgGtRnffjv/Teq6xOAWOHF ML20afPCMUxmA== Date: Wed, 5 May 2021 08:22:34 +0300 From: Leon Romanovsky To: Bjorn Helgaas Cc: Greentime Hu , paul.walmsley@sifive.com, hes@sifive.com, erik.danie@sifive.com, zong.li@sifive.com, bhelgaas@google.com, robh+dt@kernel.org, aou@eecs.berkeley.edu, mturquette@baylibre.com, sboyd@kernel.org, lorenzo.pieralisi@arm.com, p.zabel@pengutronix.de, alex.dewar90@gmail.com, khilman@baylibre.com, hayashi.kunihiko@socionext.com, vidyas@nvidia.com, jh80.chung@samsung.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: Re: [PATCH v6 1/6] clk: sifive: Add pcie_aux clock in prci driver for PCIe driver Message-ID: References: <20210504184555.GA1144324@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210504184555.GA1144324@bjorn-Precision-5520> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 04, 2021 at 01:45:55PM -0500, Bjorn Helgaas wrote: > On Tue, May 04, 2021 at 09:12:57PM +0300, Leon Romanovsky wrote: > > On Tue, May 04, 2021 at 11:23:31AM -0500, Bjorn Helgaas wrote: > > > > There are some weird/interesting bool vs int usages nearby, though: > > > > > > "bool __is_clk_gate_enabled()" goes to some trouble to convert > > > int to bool ("return (reg_val & bit_mask) != 0;"), and then > > > kona_peri_clk_is_enabled() converts the bool back to int ("return > > > is_clk_gate_enabled(bcm_clk->ccu, gate) ? 1 : 0;"). > > > > > > "int lpc32xx_clk_gate_is_enabled()" actually returns a bool that is > > > implicitly converted to int. > > > > > > Many *_is_enabled() functions return !!(...) where !! is an > > > int-to-bool conversion that is arguably unnecessary and again > > > results in an implicit conversion to int. > > > > > > I don't see any *problems* with any of these; it just seems like a > > > little more mental effort to think about all the explicit and implicit > > > conversions going on. > > > > The code is written once but read many times and I can't agree with > > your that examples given by you are not the *problems*. They clearly > > says "the API is not great and easily can be improved". > > I certainly agree that it's easier for readers if the style is > consistent. I just meant I didn't see anything that's an actual bug. No one said that it is a bug. My comment is better seen as s suggestion to the maintainers on how other subsystems keep their code base clean and up-to date. Once "the problem" is spotted, the submitter is asked to fix it globally including fixing other drivers if needed, before "new feature" can be merged. Of course, there are exceptions from this rule, but they are rare and usually given to the people who has proven record. Thanks > > Bjorn