From patchwork Mon Nov 13 13:55:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 118743 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1822313qgn; Mon, 13 Nov 2017 05:56:18 -0800 (PST) X-Google-Smtp-Source: AGs4zMb+Q7TMvJAz+C0MApSjXYWMRnwMOUCDoULZfCVUWT5ICU47y4ekj6jOj7tnxYO7PFfUpA1e X-Received: by 10.101.81.139 with SMTP id h11mr8653342pgq.233.1510581378746; Mon, 13 Nov 2017 05:56:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510581378; cv=none; d=google.com; s=arc-20160816; b=clSnoYYDPpchc5Ok1SIXfyuHxEmuRaTyGMe4XFa/OKbEOD0FQxok5OhBeSzZXtX5hH nR7p80s06Tm24jRfjW2mybfeRqIb9Nt0aCrH2QQd3MVuFLkx+jLW3q3iHT2v1wkGlD4P K6ovdl6chsh7PBdLtSfvdxSw479tSMeUDNE03YIz8RxCs+8mucitmGTPnv6HQAZu4xnx sUvIGuRlB0nD0jZn7VZh4Wg5NhB9o+CUotjMRx+NEIhoumSUxfpNw93P7I+CTYbCm9YO 7ht3T/aKmb9AhCCp/aWirbMHHQTkQw7dkEfnBipdqPbw80EL3Oz0UAlVyiNGB8wVCmFZ k/3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ye78zDHol1bAD0pbRZsBaw/aX77uPdtmjQEjIIuGh8g=; b=Onqr1Ed754hd+VaoVh+f9Y8DYBPbUEhGisINoxIh6sLF8aFclx+gxEydkxLXVugWo8 1ADkKJ42at8CnLYCoPXLAt4C/ffrdrrYgthPls8qe7v38b1L/T9KAGajST0TFP8Se//h 5laCN8eoVrO4dAO6kixkD/5AyhE2n9/HkLsUYSCkI9wJllalnI1YcgowBTuRkq58J1Nd 5cngb5uQ2EdrbRow3tNlLGfiM5UBq23RSQuMXmTxKlDU8T4xF/cfb3T4t5tcsQOa9dPX /DdtcxazDdsdUTETmjIUqRTzobyj1t7RlGLPEsXi/G4surEJpInbHn6HI6/jRYw2rPu0 cd7w== 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 a16si5657591pgn.797.2017.11.13.05.56.18; Mon, 13 Nov 2017 05:56: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 S1752992AbdKMN4R (ORCPT + 27 others); Mon, 13 Nov 2017 08:56:17 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:52975 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752962AbdKMN4P (ORCPT ); Mon, 13 Nov 2017 08:56:15 -0500 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0LtnQD-1fEYja2dt7-011E0v; Mon, 13 Nov 2017 14:56:07 +0100 From: Arnd Bergmann To: Yury Norov Cc: Arnd Bergmann , Stephen Rothwell , Andrew Morton , Clement Courbet , linux-kernel@vger.kernel.org Subject: [PATCH] lib: use correct format string for find-bit tests Date: Mon, 13 Nov 2017 14:55:45 +0100 Message-Id: <20171113135605.3166307-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0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ner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The cycles_t definition is architecture specific, which causes a link error on all architectures that use a 'long long' or 'int' type for it: lib/test_find_bit.c: In function 'test_find_last_bit': include/linux/kern_levels.h:5:18: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'cycles_t {aka long long unsigned int}' [-Werror=format=] This adds an explicit cast to 'u64' for it, which lets us use '%llu' everywhere. Fixes: 09588b1f1d58 ("lib: test module for find_*_bit() functions") Signed-off-by: Arnd Bergmann --- lib/test_find_bit.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) -- 2.9.0 Acked-by: Yury Norov diff --git a/lib/test_find_bit.c b/lib/test_find_bit.c index f3b4d34e11dd..f4394a36f9aa 100644 --- a/lib/test_find_bit.c +++ b/lib/test_find_bit.c @@ -51,7 +51,8 @@ static int __init test_find_first_bit(void *bitmap, unsigned long len) __clear_bit(i, bitmap); } cycles = get_cycles() - cycles; - pr_err("find_first_bit:\t\t%ld cycles,\t%ld iterations\n", cycles, cnt); + pr_err("find_first_bit:\t\t%llu cycles,\t%ld iterations\n", + (u64)cycles, cnt); return 0; } @@ -65,7 +66,8 @@ static int __init test_find_next_bit(const void *bitmap, unsigned long len) for (cnt = i = 0; i < BITMAP_LEN; cnt++) i = find_next_bit(bitmap, BITMAP_LEN, i) + 1; cycles = get_cycles() - cycles; - pr_err("find_next_bit:\t\t%ld cycles,\t%ld iterations\n", cycles, cnt); + pr_err("find_next_bit:\t\t%llu cycles,\t%ld iterations\n", + (u64)cycles, cnt); return 0; } @@ -79,8 +81,8 @@ static int __init test_find_next_zero_bit(const void *bitmap, unsigned long len) for (cnt = i = 0; i < BITMAP_LEN; cnt++) i = find_next_zero_bit(bitmap, len, i) + 1; cycles = get_cycles() - cycles; - pr_err("find_next_zero_bit:\t%ld cycles,\t%ld iterations\n", - cycles, cnt); + pr_err("find_next_zero_bit:\t%llu cycles,\t%ld iterations\n", + (u64)cycles, cnt); return 0; } @@ -99,7 +101,8 @@ static int __init test_find_last_bit(const void *bitmap, unsigned long len) len = l; } while (len); cycles = get_cycles() - cycles; - pr_err("find_last_bit:\t\t%ld cycles,\t%ld iterations\n", cycles, cnt); + pr_err("find_last_bit:\t\t%llu cycles,\t%ld iterations\n", + (u64)cycles, cnt); return 0; }