From patchwork Thu Dec 1 05:04:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: yanjiang.jin@windriver.com X-Patchwork-Id: 701342 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tTlth42fVz9t1B for ; Thu, 1 Dec 2016 16:18:36 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tTlth3DK8zDw3r for ; Thu, 1 Dec 2016 16:18:36 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org X-Greylist: delayed 749 seconds by postgrey-1.36 at bilbo; Thu, 01 Dec 2016 16:17:43 AEDT Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3tTlsg18FDzDvyC for ; Thu, 1 Dec 2016 16:17:42 +1100 (AEDT) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id uB154qZP009184 (version=TLSv1 cipher=AES128-SHA bits=128 verify=OK); Wed, 30 Nov 2016 21:04:52 -0800 Received: from [128.224.162.175] (128.224.162.175) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.3.294.0; Wed, 30 Nov 2016 21:04:51 -0800 Message-ID: <583FAF71.7070708@windriver.com> Date: Thu, 1 Dec 2016 13:04:49 +0800 From: yjin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Scott Wood , , , Subject: Re: [PATCH] powerpc: cputime: fix a compile warning References: <1479704219-21403-1-git-send-email-yanjiang.jin@windriver.com> <1480516844.21746.66.camel@buserror.net> In-Reply-To: <1480516844.21746.66.camel@buserror.net> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinyanjiang@gmail.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, yanjiang.jin@windriver.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi Scott, Thanks for your reminder! I rephrased it as below: -#define cputime64_to_clock_t(ct) cputime_to_clock_t((cputime_t)(ct)) +#define cputime64_to_clock_t(ct) \ + (u64)(cputime_to_clock_t((cputime_t)(ct))) and rebuilt the kernel, no warnings found. New patch is attached, could you also help me to review it? Regards! Yanjiang On 2016年11月30日 22:40, Scott Wood wrote: > On Mon, 2016-11-21 at 12:56 +0800, yanjiang.jin@windriver.com wrote: >> From: Yanjiang Jin >> >> This patch is to avoid the below warning: >> >> kernel/sched/cpuacct.c:298:25: warning: >> format '%lld' expects argument of type 'long long int', >> but argument 4 has type 'long unsigned int' [-Wformat=] >> >> Signed-off-by: Yanjiang Jin >> --- >> arch/powerpc/include/asm/cputime.h | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/arch/powerpc/include/asm/cputime.h >> b/arch/powerpc/include/asm/cputime.h >> index 4f60db0..4423e97 100644 >> --- a/arch/powerpc/include/asm/cputime.h >> +++ b/arch/powerpc/include/asm/cputime.h >> @@ -228,7 +228,8 @@ static inline cputime_t clock_t_to_cputime(const >> unsigned long clk) >> return (__force cputime_t) ct; >> } >> >> -#define cputime64_to_clock_t(ct) cputime_to_clock_t((cputime_t)(ct)) >> +#define cputime64_to_clock_t(ct) \ >> + (__force u64)(cputime_to_clock_t((cputime_t)(ct))) > Why is __force needed? > > -Scott > From c32bc6ffe070e3d79a420e6adcbed5709079dc23 Mon Sep 17 00:00:00 2001 From: Yanjiang Jin Date: Sat, 19 Nov 2016 05:04:53 +0000 Subject: [PATCH] powerpc: cputime: fix a compile warning This patch is to avoid the below warning: kernel/sched/cpuacct.c:298:25: warning: format '%lld' expects argument of type 'long long int', but argument 4 has type 'long unsigned int' [-Wformat=] Signed-off-by: Yanjiang Jin --- arch/powerpc/include/asm/cputime.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/cputime.h b/arch/powerpc/include/asm/cputime.h index 4f60db0..a25082b 100644 --- a/arch/powerpc/include/asm/cputime.h +++ b/arch/powerpc/include/asm/cputime.h @@ -228,7 +228,8 @@ static inline cputime_t clock_t_to_cputime(const unsigned long clk) return (__force cputime_t) ct; } -#define cputime64_to_clock_t(ct) cputime_to_clock_t((cputime_t)(ct)) +#define cputime64_to_clock_t(ct) \ + (u64)(cputime_to_clock_t((cputime_t)(ct))) /* * PPC64 uses PACA which is task independent for storing accounting data while -- 1.9.1