Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp205626yba; Mon, 20 May 2019 07:23:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQntT1RNyKBAA2UD67wx0P90gcrFWynK1lDO6guk6+Qvxs+/g7hgNGm3oM0fOmNx33ayk/ X-Received: by 2002:a62:ae05:: with SMTP id q5mr79190548pff.13.1558362196865; Mon, 20 May 2019 07:23:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558362196; cv=none; d=google.com; s=arc-20160816; b=C1Gyzfd7hUSmRWkD3/g/muBcIQPKiGvzu+Kv+aQseP8QMDoBWO/DQAgo2HMiPa8Bwf yfIOx/0icc009hiGs4zc55f/+1d93V9seY4t9koeeXFw52oVf5r/aMvqNw6r8sI1iPjB /3+9I6nHfSCThjaOc3IV3+uYgcawVMNNqiqTqD+8TJiQpf6UdjHq+oTgwql0rt0u4+Cl H5w7eKVAsBzFS0NwLyrzfSeZO2hBRBeYw/iIsU9JN78MeM0HexJPv4Pql5e/2bykY2Wl Q/2qOs/b8jjChrUk1BNcqnZRvnOlSY8BrOqRnS+OHgySuvvH940pk68J43xuU6BeB+OD ZNEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date; bh=UG9X2R8TQeHNNA/7BfduY4Svoib6pxwNMiMScogZR4Q=; b=jbqI3PwmSwCd0WXhqMGORIrNw2ikSOg2Oc/ee6t0S0Z3e6w15NtlKQHmejgBrRUvSA dKeEM1pYcMkjfA3a1koVRD8/9eByLl+hAEmFL2Px7CJogXtLUVQR7gZte/MJeZv4Argq c7JeBLEBRX4tq6foi0ne6ZDjXn7JY6hlGHpoCtEZQOC7DkJ/Hoh30bPmZnlwErP9in1y afES2jBo8JPV6xCTnNZKCDBGi0oq4TaIYbr/KbtWBQaOUmBgKB86Pw87Fc+EHkEZSFXS XCOJlw/1G0+Aca2nZXdE/UBugAYmThIxNtjrcTCmblUrZ2K5nBpqOlP+zaFuce65GmW4 HmWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c20si665186pgw.378.2019.05.20.07.23.00; Mon, 20 May 2019 07:23:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731539AbfETK7p (ORCPT + 99 others); Mon, 20 May 2019 06:59:45 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:56389 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731332AbfETK7o (ORCPT ); Mon, 20 May 2019 06:59:44 -0400 X-Originating-IP: 90.88.22.185 Received: from localhost (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: maxime.ripard@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 561FC1C000A; Mon, 20 May 2019 10:59:32 +0000 (UTC) Date: Mon, 20 May 2019 12:59:31 +0200 From: Maxime Ripard To: Frank Lee , rui.zhang@intel.com, Eduardo Valentin , Daniel Lezcano , robh+dt@kernel.org, Mark Rutland , Chen-Yu Tsai , catalin.marinas@arm.com, will.deacon@arm.com, David Miller , Mauro Carvalho Chehab , Greg Kroah-Hartman , Jonathan.Cameron@huawei.com, Nicolas Ferre , paulmck@linux.ibm.com, Andy Gross , olof@lixom.net, bjorn.andersson@linaro.org, Jagan Teki , marc.w.gonzalez@free.fr, stefan.wahren@i2se.com, enric.balletbo@collabora.com, devicetree@vger.kernel.org, Linux Kernel Mailing List , Linux ARM , Linux PM Subject: Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6 Message-ID: <20190520105931.5xa4j3hhxadtgxie@flea> References: <20190512082614.9045-1-tiny.windzz@gmail.com> <20190512082614.9045-3-tiny.windzz@gmail.com> <20190512221612.ubmknvim4utnqpl4@core.my.home> <20190516182936.h6xdzp3gtg4ikave@core.my.home> <20190519142239.eolisexp5mrdyafz@core.my.home> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cs6fqv7etllvtecf" Content-Disposition: inline In-Reply-To: <20190519142239.eolisexp5mrdyafz@core.my.home> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --cs6fqv7etllvtecf Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 19, 2019 at 04:22:39PM +0200, Ond=C5=99ej Jirman wrote: > On Sat, May 18, 2019 at 12:34:57AM +0800, Frank Lee wrote: > > HI, > > > > On Fri, May 17, 2019 at 2:29 AM Ond=C5=99ej Jirman = wrote: > > > > > > Hi Yangtao, > > > > > > thank you for work on this driver. > > > > > > On Fri, May 17, 2019 at 02:06:53AM +0800, Frank Lee wrote: > > > > HI Ond=C5=99ej, > > > > > > > > On Mon, May 13, 2019 at 6:16 AM Ond=C5=99ej Jirman wrote: > > > > > > + > > > > > > +/* Temp Unit: millidegree Celsius */ > > > > > > +static int tsens_reg2temp(struct tsens_device *tmdev, > > > > > > + int reg) > > > > > > > > > > Please name all functions so that they are more clearly identifia= ble > > > > > in stack traces as belonging to this driver. For example: > > > > > > > > > > sun8i_ths_reg2temp > > > > > > > > > > The same applies for all tsens_* functions below. tsens_* is too > > > > > generic. > > > > > > > > Done but no sun8i_ths_reg2temp. > > > > > > > > ths_reg2tem() should be a generic func. > > > > I think it should be suitable for all platforms=EF=BC=8C so no plat= form prefix. > > > > > > You've missed my point. The driver name is sun8i_thermal and if you g= et > > > and oops from the kernel you'll get a stack trace where there are jus= t function > > > names. If you use too generic function names, it will not be clear wh= ich > > > driver is oopsing. > > > > > > - sun8i_ths_reg2temp will tell you much more clearly where to searc= h than > > > - ths_reg2temp > > > > > > Of course you can always grep, but most thermal drivers are thermal s= ensor (ths) > > > drivers, and if multiple of them used this too-generic naming scheme = you'd > > > have hard time debugging. > > > > > > Look at other thermal drivers. They usually encode driver name in the= function > > > names to help with identification (even if these are static driver-lo= cal > > > functions). > > > > > > > Can we change to sunxi_ths_ prefix? > > It should probably match the driver name, but yes, that's better. Not really. This driver will not support all the Allwinner devices, so sunxi is seriously misleading. Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --cs6fqv7etllvtecf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXOKIjwAKCRDj7w1vZxhR xTP8APwM6R/JGZlZh8LDRMjlyCgFBIRiGljCGv2QrzA5AEuMMQD+K7kvKFJY3y7e kwh8XD4UChjl2L6sIApfpG0X2XN63Qc= =BTfA -----END PGP SIGNATURE----- --cs6fqv7etllvtecf--