From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79111C433E0 for ; Fri, 31 Jul 2020 13:10:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 519E6206FA for ; Fri, 31 Jul 2020 13:10:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="a+nu0e9n"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Y6LeKWV7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730237AbgGaNKk (ORCPT ); Fri, 31 Jul 2020 09:10:40 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:58096 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727926AbgGaNKk (ORCPT ); Fri, 31 Jul 2020 09:10:40 -0400 From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1596201037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zQ5kBwM5xQDpE3NsvWngxm6+pmYV38KeE5k+EsafdTo=; b=a+nu0e9nEYaJe8hYruXDfUCquEupcU3saiCnrUmuLLdqwkkIHGvff6OWcCFf4K6Djrhhv7 1Se0kl7aTw6d2bYpQC4SCr+LvZ9/u9LaPCKdX0CtFNyONxvgFw7UcopxV9XPfvrLH88opx MCdH7oSkzpuKLYLwVMGpXNdeNX/nhdZBKpEoXlAoPChZ/kVWyboAIlIIuoWqd0Z3fPN7FU VN5g/CzhnhWkp1T/RUOKvPc8T7Qr3oIpvjPvhtBXZbCygcgEugcN4Yj0/FHCMphaYcT746 n34Kj4yBwLHwxZc33ZjT0N3V4NeKkgTL2HJ9Yz3xA214EXZx/aT4XqHjKeMP3A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1596201037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zQ5kBwM5xQDpE3NsvWngxm6+pmYV38KeE5k+EsafdTo=; b=Y6LeKWV7Tm75A8hwiyO4d/hAL9+zyYfvREI1L0eT3pEItNWM0h3UrHru4umqkTxOtT0klC fjcNHjsCWXYKlhCw== To: Grygorii Strashko , Arnd Bergmann Cc: Richard Cochran , Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , Jakub Kicinski , Jiri Pirko , Ido Schimmel , Heiner Kallweit , Russell King , Ivan Khoronzhuk , Samuel Zou , Networking , Petr Machata Subject: Re: [PATCH v3 5/9] ethernet: ti: am65-cpts: Use generic helper function In-Reply-To: References: <20200730080048.32553-1-kurt@linutronix.de> <20200730080048.32553-6-kurt@linutronix.de> <9e18a305-fbb9-f4da-cf73-65a16bdceb12@ti.com> <87ime5ny3e.fsf@kurt> <87lfiz29di.fsf@kurt> Date: Fri, 31 Jul 2020 15:10:35 +0200 Message-ID: <87ime325kk.fsf@kurt> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri Jul 31 2020, Grygorii Strashko wrote: > On 31/07/2020 14:48, Kurt Kanzenbach wrote: >> On Thu Jul 30 2020, Arnd Bergmann wrote: >>> On Thu, Jul 30, 2020 at 11:41 AM Kurt Kanzenbach w= rote: >>>> On Thu Jul 30 2020, Grygorii Strashko wrote: >>>>> On 30/07/2020 11:00, Kurt Kanzenbach wrote: >>>>>> + msgtype =3D ptp_get_msgtype(hdr, ptp_class); >>>>>> + seqid =3D be16_to_cpu(hdr->sequence_id); >>>>> >>>>> Is there any reason to not use "ntohs()"? >>>> >>>> This is just my personal preference, because I think it's more >>>> readable. Internally ntohs() uses be16_to_cpu(). There's no technical >>>> reason for it. >>> >>> I think for traditional reasons, code in net/* tends to use ntohs() >>> while code in drivers/* tends to use be16_to_cpu(). >>> >>> In drivers/net/* the two are used roughly the same, though I guess >>> one could make the argument that be16_to_cpu() would be >>> more appropriate for data structures exchanged with hardware >>> while ntohs() makes sense on data structures sent over the >>> network. >>=20 >> I see, makes sense. I could simply keep it the way it was, or? > > I prefer ntohs() as this packet data. OK. I'll change it in the next iteration. Thanks, Kurt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEooWgvezyxHPhdEojeSpbgcuY8KYFAl8kGEsACgkQeSpbgcuY 8Kbw4A//cIz6aLHyGaPMeOOk9gT1qO3MpQFmGqIUViE1SHKR8VxzDH49UTchUBUM TrYZY1qwpaSDQ1959lnSqIT8rqQ/MrWVpwmqeOqgfXB0qTEYMXuEAhrhZ2PJ9nNO 7aYRg9/4HSrAzx/fyW+kaCiW4tBNw9zKKhyCLwzj9rOhnqAyALRY3EsZzMW7inHH kAXODyJS3tkF8bbJ7392SEii8VRB6vwYRHRVicIYFtRyFZL83czpfBuv0gZEU3pU k6FYVt7C6Udj+x7m3cFFQNgvujl0q19oDyEi7DkFGc0741lLwTrMQ/S3UREaTIwR AvO+7wFO/TnVL5WyI2qalKtShatGkRSo0emgTVqD8fHamuVijK1Tek4eNyRSn167 VOPE1Jpk0NIOw9jD4sRHFq76Va1+LoApQZXLRQfuyP/NLOlnBxlfi2NB8qGW+NoB OrUmQ05F3Vz+Wfc1/g1WhHp083c1tYn3MnzGL8zkPKuDtiMdhsDXjp9sQib80lVn PzluX9N/XXYFHD9q8mAMuiDK768h0Zj+nYGRudTICr1F5cQQMy3vywlwv0lC51/+ 0OBLkdhc+z+Sm0+FuVPT7ihDoILyTaB8xMt+qYo9ver5Bf90oEGrBIoo5GEQbOTZ BAbPVSPRQ3EMV+kgiXvP01RvyKKuDU5lDeW+bZfhIDJA5i0m9Rg= =4FMy -----END PGP SIGNATURE----- --=-=-=--