From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: [PATCH v1 net-next] net: dsa: microchip: add KSZ9477 I2C driver Date: Wed, 19 Dec 2018 18:22:20 +0100 Message-ID: <20181219172220.GA14258@amd> References: <1545190897-22622-1-git-send-email-Tristram.Ha@microchip.com> <20181219100532.GA2066@nanopsycho> <20181219160857.GA13878@amd> <20181219161532.GA2224@nanopsycho> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cWoXeonUoKmBZSoM" Cc: Pavel Machek , Tristram.Ha@microchip.com, Sergio Paracuellos , Andrew Lunn , Florian Fainelli , Marek Vasut , Dan Carpenter , vivien.didelot@savoirfairelinux.com, UNGLinuxDriver@microchip.com, netdev@vger.kernel.org To: Jiri Pirko Return-path: Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:47324 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727716AbeLSRWX (ORCPT ); Wed, 19 Dec 2018 12:22:23 -0500 Content-Disposition: inline In-Reply-To: <20181219161532.GA2224@nanopsycho> Sender: netdev-owner@vger.kernel.org List-ID: --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed 2018-12-19 17:15:32, Jiri Pirko wrote: > Wed, Dec 19, 2018 at 05:08:57PM CET, pavel@denx.de wrote: > >Hi! > > > >> >+static int ksz_i2c_write32(struct ksz_device *dev, u32 reg, u32 valu= e) > >> >+{ > >> >+ value =3D cpu_to_be32(value); > >> >+ return ksz_i2c_write(dev, reg, &value, 4); > >> >+} > >> >+ > >> >+static int ksz_i2c_get(struct ksz_device *dev, u32 reg, void *data, = size_t len) > >> >+{ > >> >+ return ksz_i2c_read(dev, reg, data, len); > >> >+} > >> >+ > >> >+static int ksz_i2c_set(struct ksz_device *dev, u32 reg, void *data, = size_t len) > >> >+{ > >> >+ return ksz_i2c_write(dev, reg, data, len); > >> >+} > >>=20 > >>=20 > >> This header file makes no sense. Please move the functions into .c > > > >No, that would make code bigger & slower. > > > >It makes sense to me. But I'd add "inline" keyword to make the goal > >explicit. >=20 > 1) It makes no sense to have header files for things like this. The > functions are only used within the single .c file. >=20 > 2) You cannot inline them, as they are used as ops. Ok, sorry for the noise. Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --cWoXeonUoKmBZSoM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlwafkwACgkQMOfwapXb+vJBkQCfXXzOZiKG318rS2IwsU4w6I4/ mQoAoIWhJYY3+53P8fHMUsBgstHwDqOp =9GPh -----END PGP SIGNATURE----- --cWoXeonUoKmBZSoM--