Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1824978imm; Mon, 3 Sep 2018 10:24:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaeNIOXdXqOrk2akMkkZ2A61vZxrw2H8Y0/7Q7vQ2DUHGexMy7JdcknBQFykTLhLYsO5E9Q X-Received: by 2002:a17:902:904c:: with SMTP id w12-v6mr29567327plz.95.1535995448247; Mon, 03 Sep 2018 10:24:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995448; cv=none; d=google.com; s=arc-20160816; b=hAUs8i2mTrKBsQ6OOO00K3/Fi9dbujh0YWCjUeHt39JPENMFKXiqsQTMG96HVvLEsU JCfJQemFtejiXt4OsQRLSfYkFJgG0inybF2nz7pFcXj8nxQ2W4ktvvwxauzFNZlUcmgR wUJEAb7F8WpSNKJsRCpIWHc0R6yBTBa+PC/wnfoZmGueQW6kQ9Ey8bnW0Q5QeVpgDRI6 Si+4oJmQ+N7d9+AkrIltZyFXuF3ATFbhVDGF0LRifJKSfjKtQjVnkzGK358TEXxoeaCi nWMISq+CGWySbpgE5qSHxXrDPYuBEe5HtyuikW5VupL+gZSvqPSQ8rosgTmfFEcPpKMC O51w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=tvXUbzsd72qEAeSIQDlORRsGJXEEekkyIXIkbYVtrRE=; b=upSj9PoHgfIfH5ss9yriAiJvri1radobjTSFkyS5E+/f2SBiio5xA7XhXL60AjA9Sn o+kM30Qlz801nMu42KXgxGTvE3acJ9Nf6S3jLkHscFYEleVXFXsmiAl8zQ4aFDNlNTjC VjRmAwe2OZN5bSLagEtx4e9Sut5EG/pTsroW/E92sibNvD/nvdzqoqVgXS90eVkTbfnw g/Wtbyhvsx/hud861FmIU4ER8JOK6SGUbQOJxSlnYvy4orwyZVnIQYa2nufs5rR3swsz MjE1PSPRvWlI4FrVkTagtHVK7Geann+TgZ/nNu7j4iFiJ+ScItSNANwCu9PBLxb6tuZT Kv4Q== 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 b10-v6si19027533pgi.416.2018.09.03.10.23.53; Mon, 03 Sep 2018 10:24:08 -0700 (PDT) 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 S1730370AbeICVjo (ORCPT + 99 others); Mon, 3 Sep 2018 17:39:44 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43090 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728967AbeICVjn (ORCPT ); Mon, 3 Sep 2018 17:39:43 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7B91AD14; Mon, 3 Sep 2018 17:18:38 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, linux-snps-arc@lists.infradead.org, Ofer Levi , Leon Romanovsky , Randy Dunlap , Vineet Gupta , Sasha Levin Subject: [PATCH 4.14 066/165] arc: [plat-eznps] fix printk warning in arc/plat-eznps/mtm.c Date: Mon, 3 Sep 2018 18:55:52 +0200 Message-Id: <20180903165658.428765344@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Randy Dunlap [ Upstream commit 9e2ea405543d9ddfe05b351f1679e53bd9c11f80 ] Fix printk format warning in arch/arc/plat-eznps/mtm.c: In file included from ../include/linux/printk.h:7, from ../include/linux/kernel.h:14, from ../include/linux/list.h:9, from ../include/linux/smp.h:12, from ../arch/arc/plat-eznps/mtm.c:17: ../arch/arc/plat-eznps/mtm.c: In function 'set_mtm_hs_ctr': ../include/linux/kern_levels.h:5:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long int' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^~~~~~ ../include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH' #define KERN_ERR KERN_SOH "3" /* error conditions */ ^~~~~~~~ ../include/linux/printk.h:308:9: note: in expansion of macro 'KERN_ERR' printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~ ../arch/arc/plat-eznps/mtm.c:166:3: note: in expansion of macro 'pr_err' pr_err("** Invalid @nps_mtm_hs_ctr [%d] needs to be [%d:%d] (incl)\n", ^~~~~~ ../arch/arc/plat-eznps/mtm.c:166:40: note: format string is defined here pr_err("** Invalid @nps_mtm_hs_ctr [%d] needs to be [%d:%d] (incl)\n", ~^ %ld The hs_ctr variable can just be int instead of long, so also change kstrtol() to kstrtoint() and leave the format string as %d. Also add 2 header files since they are used in mtm.c and we prefer not to depend on accidental/indirect #includes. Cc: linux-snps-arc@lists.infradead.org Cc: Ofer Levi Reviewed-by: Leon Romanovsky Signed-off-by: Randy Dunlap Signed-off-by: Vineet Gupta Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arc/plat-eznps/mtm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/arch/arc/plat-eznps/mtm.c +++ b/arch/arc/plat-eznps/mtm.c @@ -15,6 +15,8 @@ */ #include +#include +#include #include #include #include @@ -157,10 +159,10 @@ void mtm_enable_core(unsigned int cpu) /* Verify and set the value of the mtm hs counter */ static int __init set_mtm_hs_ctr(char *ctr_str) { - long hs_ctr; + int hs_ctr; int ret; - ret = kstrtol(ctr_str, 0, &hs_ctr); + ret = kstrtoint(ctr_str, 0, &hs_ctr); if (ret || hs_ctr > MT_HS_CNT_MAX || hs_ctr < MT_HS_CNT_MIN) { pr_err("** Invalid @nps_mtm_hs_ctr [%d] needs to be [%d:%d] (incl)\n",