From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753292AbbCWQ6t (ORCPT ); Mon, 23 Mar 2015 12:58:49 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:36196 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752994AbbCWQ6q (ORCPT ); Mon, 23 Mar 2015 12:58:46 -0400 Date: Mon, 23 Mar 2015 17:58:39 +0100 From: Richard Cochran To: Chris Metcalf Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Amir Vadai , Ariel Elior , Arnd Bergmann , Baolin Wang , Ben Hutchings , Bruce Allan , Carolyn Wyborny , David Miller , Frank Li , Giuseppe Cavallaro , Jeff Kirsher , John Stultz , Luwei Zhou , Matthew Vick , Michael Chan , Prashant Sreedharan , Shradha Shah , Solarflare linux maintainers , Sonic Zhang , Stefan =?iso-8859-1?Q?S=F8rensen?= , Thomas Gleixner , Tom Lendacky Subject: Re: [PATCH net-next V2 19/23] ptp: tilegx: convert to the 64 bit get/set time methods. Message-ID: <20150323165839.GA4330@localhost.localdomain> References: <8bc233b19d08308c01015936841d9be8d4441ece.1426973658.git.richardcochran@gmail.com> <551038FB.2070200@ezchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <551038FB.2070200@ezchip.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 23, 2015 at 12:02:03PM -0400, Chris Metcalf wrote: > This driver is 64-bit only. Would it make more sense to just change > the accessors from gettime/settime to gettime/settime64 and nothing > else, i.e. rely on the current behavior that timespec and timespec64 > are the same type, and trust the compiler to fail it if somehow someone > tried to build this driver into a 32-bit kernel? On the one hand, I think the best way would be for gxio_mpipe_get/set_timestamp to also take a timespec64, because it makes the width clear. With a plain old timespec, you have to remember whether you are 64 bit or not. However, but I couldn't tell if changing gxio_mpipe_get/set_timestamp would work for other callers or not. If the driver is 64 bit only, shouldn't that be reflected in the Kconfig? On the other hand, I wouldn't mind the change you suggest, if it were super obvious that the code is 64 bit only. It was not obvious to me. Thanks, Richard From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Cochran Subject: Re: [PATCH net-next V2 19/23] ptp: tilegx: convert to the 64 bit get/set time methods. Date: Mon, 23 Mar 2015 17:58:39 +0100 Message-ID: <20150323165839.GA4330@localhost.localdomain> References: <8bc233b19d08308c01015936841d9be8d4441ece.1426973658.git.richardcochran@gmail.com> <551038FB.2070200@ezchip.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Amir Vadai , Ariel Elior , Arnd Bergmann , Baolin Wang , Ben Hutchings , Bruce Allan , Carolyn Wyborny , David Miller , Frank Li , Giuseppe Cavallaro , Jeff Kirsher , John Stultz , Luwei Zhou , Matthew Vick , Michael Chan , Prashant Sreedharan , Shradha Shah , Solarflare linux maintainers , Sonic Zhang , Stefan =?iso-8859-1?Q?S=F8rensen?= Return-path: Content-Disposition: inline In-Reply-To: <551038FB.2070200@ezchip.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Mon, Mar 23, 2015 at 12:02:03PM -0400, Chris Metcalf wrote: > This driver is 64-bit only. Would it make more sense to just change > the accessors from gettime/settime to gettime/settime64 and nothing > else, i.e. rely on the current behavior that timespec and timespec64 > are the same type, and trust the compiler to fail it if somehow someone > tried to build this driver into a 32-bit kernel? On the one hand, I think the best way would be for gxio_mpipe_get/set_timestamp to also take a timespec64, because it makes the width clear. With a plain old timespec, you have to remember whether you are 64 bit or not. However, but I couldn't tell if changing gxio_mpipe_get/set_timestamp would work for other callers or not. If the driver is 64 bit only, shouldn't that be reflected in the Kconfig? On the other hand, I wouldn't mind the change you suggest, if it were super obvious that the code is 64 bit only. It was not obvious to me. Thanks, Richard