Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1141526pxy; Thu, 29 Apr 2021 00:08:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkk6pT+t55wxrTL0L661qQWHdE/7ujvFcnLIAS+F5LWr/4WvsxBQD+Pae7uOt/yaPfh90h X-Received: by 2002:aa7:c2cc:: with SMTP id m12mr16229293edp.1.1619680102482; Thu, 29 Apr 2021 00:08:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619680102; cv=none; d=google.com; s=arc-20160816; b=P7G9IXoTrPUwAkhwTPX/MgmKCndxCTXyXsdPXPwGt6VTBy54uV/W0V30Bvhc9YOYrv hef6xLQSn34t0DzlUHEdxyG60a7OiZoSPGzRTB3imTWpDZni6mgjcT0FwEvpqlFzlXXT WBiJrzVVgBfFuBiOa9HawG9FmbWOZzKLfhRbcqkg4uU/xtAaY8r79t3oWieju3y52Z1b cpVX2yhXXzsM3Vet+8uqLBify3DAzp9vWw335t46afej0ck8/dcjloNSwpK01Gzfx/Yc X/QoKjpztDoaBHJAFsc/OWMlAHYqzqhnLwFa1/m4mRUgZgED2++ozLkyPBED/Y6e6SNp XOtQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=kr8BmFndPx3gvcqViLkXwW6+aAE4CRPNFv47IW8MWfE=; b=XMHUn/Ic4D9Prfz0+cuyniK1uMY+CxbvbLXZBL+yC5AnB8VaKj82Dy3O31flw5Gtyb Zhzqal0bCyhK2wHQzCFbZ+llrPMHr3o5J8HZxfM6HBASIebsmiY+sUzIPvhGEv/4cZXj v+ZbTbxYAdAkF+NvpfFAjmyOSX40tvVFW02qZfIyDcJfOIaUoJ2SmGWwAmRPP9xuI1Rj vriiXBQiE8Jd/TDrOk1JCe3zfJfY4e6fUtMk0l479iSvxf06QcU4e5YEQLFVNv5xFZ1r vlU3NjnHEBdft2Jd513XU+RsbgQGIGfslZcDzrHUnKs28z2fiLd52AwxWJg2nuAFZba5 7fuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WOEzMDCC; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hb7si2413001ejc.507.2021.04.29.00.07.59; Thu, 29 Apr 2021 00:08:22 -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=@linaro.org header.s=google header.b=WOEzMDCC; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233358AbhD2HHo (ORCPT + 99 others); Thu, 29 Apr 2021 03:07:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237286AbhD2HHo (ORCPT ); Thu, 29 Apr 2021 03:07:44 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A4C4C06138C for ; Thu, 29 Apr 2021 00:06:57 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id t18so8047542wry.1 for ; Thu, 29 Apr 2021 00:06:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=kr8BmFndPx3gvcqViLkXwW6+aAE4CRPNFv47IW8MWfE=; b=WOEzMDCC8eYunFMSsYUbqrepv32DAs+Z5JFboR/vBer0Jv4hmk1l6sXGM0jpgKUNDC cosKRcBydCW4G2UkVVThs5Bv4HcAvhnMbotFoyiXxbwFyVm42p7nv17GIs8Ne1qZQLvh rnqDN2tpZouZQpXfrxo9EmzzIJf7iXxoSX1j1gMp+6IxFHFwRSAbq2pM6qwgtiRwqO+s A4s1T+8NOF7HMrynXvljhe6MUHQbcKQD9xiHx7s62uBnox8xygF4Lq6DZCxedy9IvEtE Pu+cnn0XuKsunl/npoR9jzly7c7B8InC0QrvyF6iM5SMwlGGui2HdFNrahBIKFcXNf9g KVew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=kr8BmFndPx3gvcqViLkXwW6+aAE4CRPNFv47IW8MWfE=; b=t8f10xAMilvFDa+cQpLEBP9y2ZnEOWDKnR96TaidH/r/6f2V3ubyoXcAtJgrYzQxgX jEDwVKaI2DQC+CzVICF+hlOy9e+GnQb8u/a6oIvbB9n3g2pktIgzAtBYWUZKQUvltDdI naye+0GH7AuM6Ajf+W0o9/74WALj6D+Ffw07Wduvv8DY8x0jVRTZiD9QUIejiuwsGd5b b9Gakl/n5kJOAi13FRI79QYykRDEQupyz8dhvPNXGdGm1s2lii6jOTaS1lcd1dNJFnfF lFjkfH/Ge6K1eMH7SCvJKiJSt/g4nlefL7n/dekIoA3E+4cVV3KZ3rKPApN7yy3CUD+p XdrA== X-Gm-Message-State: AOAM532JcQ4aGNBh8+pZAxEGEOhrz7oLJZvt0MVaABOGWFKPlFVBhNGx HlXluVNd/gWRe/N+zgf20SvokQ== X-Received: by 2002:adf:e98d:: with SMTP id h13mr26997701wrm.1.1619680016198; Thu, 29 Apr 2021 00:06:56 -0700 (PDT) Received: from dell ([91.110.221.215]) by smtp.gmail.com with ESMTPSA id r18sm3658131wrs.90.2021.04.29.00.06.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 00:06:55 -0700 (PDT) Date: Thu, 29 Apr 2021 08:06:53 +0100 From: Lee Jones To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Thierry Reding , Fenglin Wu , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, subbaram@codeaurora.org, collinsd@codeaurora.org, aghayal@codeaurora.org Subject: Re: [PATCH 2/2] pwm: pwm-qcom: add driver for PWM modules in QCOM PMICs Message-ID: <20210429070653.GJ6446@dell> References: <20210427102247.822-1-fenglinw@codeaurora.org> <20210427102247.822-3-fenglinw@codeaurora.org> <20210427170748.wglupc6zwrndalxs@pengutronix.de> <20210429065213.inajpznvfxa2xsld@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210429065213.inajpznvfxa2xsld@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 29 Apr 2021, Uwe Kleine-König wrote: > Hello, > > On Wed, Apr 28, 2021 at 07:46:56PM +0200, Thierry Reding wrote: > > On Tue, Apr 27, 2021 at 07:07:48PM +0200, Uwe Kleine-König wrote: > > > I would like to see the register definition to use a common prefix (like > > > QCOM_PWM_) and that the names of bit fields include the register name. > > > So something like: > > > > > > #define QCOM_PWM_PWM_SIZE_CLK 0x41 > > > #define QCOM_PWM_PWM_SIZE_CLK_FREQ_SEL GENMASK(1, 0) > > > > > > even if the names are quite long, its usage is less error prone. Maybe > > > it makes sense to drop the duplicated PWM (but only if all or no > > > register contains PWM in its name according to the reference manual). > > > Also maybe QCOM_PWM_PWMSIZECLK_FREQSEL might be a good choice. I let you > > > judge about the details. > > > > Please stop requesting this. A common prefix is good for namespacing > > symbols, but these defines are used only within this file, so there's no > > need to namespace them. > > I do consider it important. The goal of my review comments is to improve > the drivers according to what I consider sensible even if that might not > fit your metrics. > > Consistent name(space)ing is sensible because the names of static > functions are used in backtraces. It is sensible because tools like > ctags, etags and cscope work better when names are unique. It is > sensible because it's harder than necessary to spot the error in > > writel(PWM_EN_GLITCH_REMOVAL_MASK, base + REG_ENABLE_CONTROL); > > . It is sensible because the rule "Use namespacing for all symbols" is > easier than "Use namespacing for symbols that might conflict with > (present or future) names in the core or that might appear in user > visible messages like backtraces or KASAN reports". It's sensible > because then it's obvious when reading a code line that the symbol is > driver specific. It is useful to have a common prefix for driver > functions because that makes it easier to select them for tracing. > > > Forcing everyone to use a specific prefix is just going to add a bunch > > of characters but doesn't actually add any value. > > That's your opinion and I disagree. I do see a value and the "burden" of > these additional characters is quite worth its costs. In my bubble most > people also see this value. This includes the coworkers I talked to, > several other maintainers also insist on common prefixes[1] and it > matches what my software engineering professor taught me during my > studies. I also agree that longer names are more annoying than short > ones, but that doesn't outweigh the advantages in my eyes and a good > editor helps here. FWIW, I'm +1 for proper namespacing for the purposes of; tracing, logging and future proofing, even if it does add a few more chars. Less of a problem now the 80-char rule is waning. -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog