From patchwork Tue Jul 24 20:46:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 948843 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="C7FhmcfV"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="U6EV0zAk"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Zr4y6kG4z9s0n for ; Wed, 25 Jul 2018 06:46:58 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=5p2K4yaB2JuG3HEdGoy9CIn4yeXNgSXLwK/D6MzKoxc=; b=C7FhmcfVd/E7Gkjo8ZI5s91wDn MKAVXXI1rsJjGCpJrdx4V0MXsJvD19wXDHZyyY3SEvdClF1qfOSGvFV8HX+kB1FINgBwg6/ViheBh mjeeYNKRFfSUZH0oakXplfSEZmtOMOibuY7K/DtgS9ufIQVKbhH3gXLbwOeDbl22/Lfhpi+fQZ9E7 OxMmInQJYmFCQqGoe+hyufyXHXbWMAGwnJkJOD+bz5do86UJhdaPmVEz+UMZdORlOkiA5FSTVcEdf 6kdi3S7CGYnDPZo9l/gjZbxYOI1bYR/b/kcqGLFES3tC2PuBmxozAXbnYYUWYoKzALdlb8n72of66 4a+huEJg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fi4Cu-00035w-S2; Tue, 24 Jul 2018 20:46:56 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fi4Cl-0002oH-GZ for linux-snps-arc@lists.infradead.org; Tue, 24 Jul 2018 20:46:51 +0000 Received: by mail-pf1-x441.google.com with SMTP id i26-v6so1123152pfo.12 for ; Tue, 24 Jul 2018 13:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XtfFhHEt3EkJlIqJNHyspIwd4qHNMEMPbZzoxZEnm8Q=; b=U6EV0zAk09lztZbCmB1YpV6hebvoKtacQFD8/fyZQVY15oPISV7pDf0Kn3MyCxiys6 LxXfFoQd0oWquSyb9VA53xYlB+aCl8l9qo3SUPBCBkrqhUaQj2LC1Py/IhQySW6LeVWO zfgw7ZepVyFi2gSjLSfDVxxP2Kq7JLAICXG9HqNL4rFYOg2pQNmIB5YYm/ySXT2R+0ro Bh+CBYrsWYetL9PwytTu10ny1SZLnpB4gzR62wS9+Y9VdhyuhijVk2RZ9yDiGkxnU855 ZD/8N0qFhKc8nXzom1DgjMrqDlMBVRZJ9TEla+HHyLm1xgV3T1tCtuZrKS2FO3p0O7+u MJrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XtfFhHEt3EkJlIqJNHyspIwd4qHNMEMPbZzoxZEnm8Q=; b=l6qAJzcCswA3HoUWjBcBgFm8jVhN6YgAgqDea8lQroqVchMOs6eQrBGTDTa9RKIyTR O4s7N7pS3yiYaTV40hbDLBJQtjl/l5fzSQGtjiWnUA5oKzktRTayW7aYeJnaOSlTd1Ei sKYleSNdtmDFnec/yS1yLo6+TXBK5VN6o967eo/9pbE5JmSjUoSTJK6DWXKZKlU9A0eb cMIPpTBJ740PNVeDF7mBxa9EVNvDZmBMXfr0nFsT5j47+L2fX996MP/tUkxmlpQMoEFY W5daZbnJT8qe9LWGqXT8RuerLidAcKtRZEcV3GVh8dJYlfdx5SLkLCyJG4lK02Yycfzu cmHw== X-Gm-Message-State: AOUpUlGsT7LVcfU6XPfUdB0MZCPeRv33XHYUeDCDULfMVDYzM2eHFxUI MFpIKAtppJjCWZjIPV29tl4= X-Google-Smtp-Source: AAOMgpcytVyA6Yn96RapXHPOUq2lchg4rCiLPX02DwWt3a/6rXp4obaCnKFDuUpzQgs8igUFJDQCMA== X-Received: by 2002:a63:2106:: with SMTP id h6-v6mr17704332pgh.161.1532465196872; Tue, 24 Jul 2018 13:46:36 -0700 (PDT) Received: from midway.home (static-50-53-52-16.bvtn.or.frontiernet.net. [50.53.52.16]) by smtp.gmail.com with ESMTPSA id t21-v6sm21536110pfi.73.2018.07.24.13.46.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jul 2018 13:46:35 -0700 (PDT) From: Randy Dunlap To: linux-kernel@vger.kernel.org Subject: [PATCH 4/4] arc: fix mtm.c printk format warning Date: Tue, 24 Jul 2018 13:46:22 -0700 Message-Id: <20180724204622.2366-5-rd.dunlab@gmail.com> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20180724204622.2366-1-rd.dunlab@gmail.com> References: <20180724204622.2366-1-rd.dunlab@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180724_134647_989644_4C7601E3 X-CRM114-Status: GOOD ( 10.85 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:441 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (rd.dunlab[at]gmail.com) -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vineet Gupta , Randy Dunlap , Ofer Levi , linux-snps-arc@lists.infradead.org MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Randy Dunlap 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. Signed-off-by: Randy Dunlap Cc: Vineet Gupta Cc: Ofer Levi Cc: linux-snps-arc@lists.infradead.org --- arch/arc/plat-eznps/mtm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- linux-next-20180723.orig/arch/arc/plat-eznps/mtm.c +++ linux-next-20180723/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",