From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 54814ECAAD4 for ; Mon, 29 Aug 2022 06:23:27 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8A58084941; Mon, 29 Aug 2022 08:23:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1661754205; bh=aE7VBC2bz9edeHo8fn7XGm7FxCdR3seH4hriqvH1Smw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=dQ+vtrxaO/LOEeIXlcNzjI8n90+pqoPYvXT/QV3KMxGhUX/p6XGQ+ZscUmj9Y2/kf UOEdEAL5buJWzrko6d5uDEr4dWR3bWG08amhy5WdlHBRrZVKLw1xULRQRxeWF5Gun8 RjI5rh+/XYD2dAeu2VQCKL+xmEhqHrit0P3FDXtpK0grtOS08yMdjFRcFVYXcy+0jX GGrMDl3xTXwEtTHiq96Gg90UfJHOcgKYz3iTQnx2r/if/d6/Vn/l4Tzo0qjg5aKFRK 2ed1nx10SGqMIWjsHuiI1CIP0BoaK9eOPUzJaGHcoZQS30Yq9pS4FunCWKtxyK6Pt1 HQ5iCTDsvElnw== Received: by phobos.denx.de (Postfix, from userid 109) id 1D1548496C; Mon, 29 Aug 2022 08:23:23 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [80.241.59.204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D68E9847E6 for ; Mon, 29 Aug 2022 08:23:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4MGL3V692wz9sQZ; Mon, 29 Aug 2022 08:23:18 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: trini@konsulko.com, sjg@chromium.org, rasmus.villemoes@prevas.dk Subject: [RFC PATCH 1/8] cmd/cyclic: Use div64 macros for division and remainder Date: Mon, 29 Aug 2022 08:23:06 +0200 Message-Id: <20220829062313.32654-2-sr@denx.de> In-Reply-To: <20220829062313.32654-1-sr@denx.de> References: <20220829062313.32654-1-sr@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4MGL3V692wz9sQZ X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Use the do_div etc for divisions to fix the compile breakage seen on edison: cmd/cyclic.c:70: undefined reference to `__udivmoddi4' and for e.g. MIPS netgear_cg3100d_ram: cmd/cyclic.c:(.text.do_cyclic_list+0x180): undefined reference to `__umoddi3' Signed-off-by: Stefan Roese --- cmd/cyclic.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/cyclic.c b/cmd/cyclic.c index d936f3b8d099..6d14c22e4215 100644 --- a/cmd/cyclic.c +++ b/cmd/cyclic.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -67,10 +68,10 @@ static int do_cyclic_list(struct cmd_tbl *cmdtp, int flag, int argc, list_for_each_entry_safe(cyclic, tmp, &cyclic_list, list) { cnt = cyclic->run_cnt * 1000000ULL * 100ULL; - freq = cnt / (timer_get_us() - cyclic->start_time_us); - printf("function: %s, cpu-time: %lld us, frequency: %lld.%02lld times/s\n", + freq = lldiv(cnt, timer_get_us() - cyclic->start_time_us); + printf("function: %s, cpu-time: %lld us, frequency: %lld.%02d times/s\n", cyclic->name, cyclic->cpu_time_us, - freq / 100, freq % 100); + lldiv(freq, 100), do_div(freq, 100)); } return 0; -- 2.37.2