Received: by 10.223.185.116 with SMTP id b49csp473267wrg; Wed, 21 Feb 2018 01:22:18 -0800 (PST) X-Google-Smtp-Source: AH8x2256SkglAB3HlVUEKt+5n5QeJiHozR418H4pHgSoaMm6l1QVwwaOI/fHOqLcd3VSZ9HljbIA X-Received: by 10.98.182.8 with SMTP id j8mr2650022pff.166.1519204938543; Wed, 21 Feb 2018 01:22:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519204938; cv=none; d=google.com; s=arc-20160816; b=NK6t1zz88w7mNM4w2BCO9xt1VWh4FMuTG8qSpcYzKnLTFL7+eyhdhLWNON01yfRTIQ Bqlu/mT8gs1js3Z4XHM4G4X0nr+PjXvrMEdyClWeukeLnoXoSkc1RAwQFa5Bx/TD8Bpm AqH7e++Z4Qef+ortrPNhWgoFfjTY7SqVL5D6iA17mRKW/g+PAyzdmQFXdAN+n+mR0o0n 7lfN65sUR1ss7nMsHg2p0nTPz493qtI5kQ1T6YwDMK7UZarXFw8X8aSoYpwBnXL+SXWJ IV7ZZh3o6a1clyXsCtO3yhkpo8AUJrQEoqKV8P9BhyUyjTV31zTEQ9uGWIQP2W/Ws197 lONQ== 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:cc :to:from:date:arc-authentication-results; bh=CvHnXeeAmU59yzK8aKUQ19h4a/1Dgg4x9Cwg+njGi+I=; b=qlPICwHE5JO9/00nRqyKNuxtyqwizutliZ2/MxLKx9Wgf6OzyRcXlEjUiZwEkla+k7 IobHrPX5TbBY6ZL4yYwaDhypqaJZO4SNodgciYMLnXe8V4CRtnhP/R0dr4aL7iCTtLni LNanB3mFJO3m/3tOpSK1kJkB9p4lbbDTNthq40p+wCQhPKBCUnv8gCrX/xjyCvESt6/o RDIWVsZVUuZIN2bJQZHOo1vsVtX2y1sbJs+hOvDcou/34BPDStIv4lVMm3IThWLdiLHd HHTKQTB4/GdZPbQrLR8a0ngsb7rOlV395og+EfFGSulGPRYfe33rbvscao+17cFJ1rAn UKQw== 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 33-v6si1486723pls.710.2018.02.21.01.22.03; Wed, 21 Feb 2018 01:22:18 -0800 (PST) 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 S932115AbeBUJQw (ORCPT + 99 others); Wed, 21 Feb 2018 04:16:52 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:54222 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932094AbeBUJQt (ORCPT ); Wed, 21 Feb 2018 04:16:49 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id B2737207E7; Wed, 21 Feb 2018 10:16:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.free-electrons.com (Postfix) with ESMTPSA id 7A267203B0; Wed, 21 Feb 2018 10:16:37 +0100 (CET) Date: Wed, 21 Feb 2018 10:16:37 +0100 From: Alexandre Belloni To: Joe Perches Cc: Andy Shevchenko , Rasmus Villemoes , Greg Kroah-Hartman , Andrew Morton , linux-kernel@vger.kernel.org, Alessandro Zummo , linux-rtc@vger.kernel.org, Arnd Bergmann , Mark Salyzyn , Bartlomiej Zolnierkiewicz , Dmitry Torokhov , Geert Uytterhoeven , Guan Xuetao , Ingo Molnar , Jason Wessel , Jonathan Corbet , Jonathan Hunter , Krzysztof Kozlowski , "Rafael J. Wysocki" , Thierry Reding Subject: Re: [PATCH v2 01/21] lib/vsprintf: Print time and date in human readable format via %pt Message-ID: <20180221091637.GK18058@piout.net> References: <20180220214400.66749-1-andriy.shevchenko@linux.intel.com> <20180220214400.66749-2-andriy.shevchenko@linux.intel.com> <1519170907.4326.17.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1519170907.4326.17.camel@perches.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/02/2018 at 15:55:07 -0800, Joe Perches wrote: > On Tue, 2018-02-20 at 23:43 +0200, Andy Shevchenko wrote: > > +static noinline_for_stack > > +char *time_str(char *buf, char *end, const struct rtc_time *tm, bool v, bool r) > > +{ > > Maybe use unsigned int temporaries here too for hour, min, sec > > > + if (unlikely(v && (unsigned int)tm->tm_hour > 24)) > > + buf = string(buf, end, "**", default_str_spec); > > + else > > + buf = number(buf, end, tm->tm_hour, default_dec02_spec); > > + > > + if (buf < end) > > + *buf = ':'; > > + buf++; > > + > > + if (unlikely(v && (unsigned int)tm->tm_min > 59)) > > leap seconds are allowed in the struct > No, they are not: https://elixir.bootlin.com/linux/v4.15.4/source/drivers/rtc/rtc-lib.c#L108 -- Alexandre Belloni, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com