From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Subject: Re: [PATCH 2/3] thermal: sun50i: add thermal driver for h6 Date: Mon, 20 May 2019 12:59:31 +0200 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" Return-path: Content-Disposition: inline In-Reply-To: <20190519142239.eolisexp5mrdyafz@core.my.home> Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: devicetree@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--