From patchwork Wed Nov 6 19:41:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 11231019 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94D2A139A for ; Wed, 6 Nov 2019 19:41:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7BF6B217F9 for ; Wed, 6 Nov 2019 19:41:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BF6B217F9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE8B16E2B6; Wed, 6 Nov 2019 19:41:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb1-xb42.google.com (mail-yb1-xb42.google.com [IPv6:2607:f8b0:4864:20::b42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 02E236E2B6 for ; Wed, 6 Nov 2019 19:41:24 +0000 (UTC) Received: by mail-yb1-xb42.google.com with SMTP id g17so1940261ybd.13 for ; Wed, 06 Nov 2019 11:41:24 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=NvgyCff0GePlerjT69t0v19TBkJEtLkh6wnpQ4SPkWU=; b=KCEywrcK0tuPICIGan+34wKZdUcE4CkNGeFtSTI/lsqSsLbXyeAZzy7hUNj+ZCQ1Zf LBGQq5iwVXEl+5Q4XhWnqGj43ZHpxmbchx1VOB6A3UfsE1RGQvjhgSox9RM9LXt30pRu PuQP0GDEhT126iparMIsk0fTFxKdIk+fx7ERNHu65MiVTURGHr2gI4vqwV4awocwXd2s 3U0xEV2cK0v4CnPFIwmrMoBaKiJWGJPRAqR0QjuT28ny5deBhgrYMDG1p/X7dw5mf2RK +ojTCSjIRAO03UnYRkrjL+fHXmt/+bdSjCYXChHVPLJMwmhM1wpt95m5+ZOsZ0Dk5Pnn 2QjQ== X-Gm-Message-State: APjAAAXxwiMnGCXD4bw73NOPJDc0Nd+WuWRdKUY9aFIhtTbsEJqtzHxg JEyXMwWY2SLysR/8nyfhslL2nXWzjGc= X-Google-Smtp-Source: APXvYqz+wJFvghOSJxmwhPMveDNtDIKhQ74ZzUyI9fFSSvrKhjSpPT49p1u4WaVO/0kC/necNji76w== X-Received: by 2002:a25:d7c5:: with SMTP id o188mr3639702ybg.336.1573069283723; Wed, 06 Nov 2019 11:41:23 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id p83sm1279808ywc.11.2019.11.06.11.41.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 11:41:22 -0800 (PST) From: Sean Paul To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/mst: Fix up u64 division Date: Wed, 6 Nov 2019 14:41:15 -0500 Message-Id: <20191106194121.164458-1-sean@poorly.run> X-Mailer: git-send-email 2.24.0.rc1.363.gb1bccd3e3d-goog In-Reply-To: <20191106182813.GV1208@intel.com> References: <20191106182813.GV1208@intel.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NvgyCff0GePlerjT69t0v19TBkJEtLkh6wnpQ4SPkWU=; b=PGThtIUErj59ObfRg+zcF04BYRzGGwc2Gk4aXl4+EmRwrvodHZFkfaUjwvi0UiZbXa 7NC1sbDsu5sKNYRlcqE+uAmjl51uKBXsXdotoDrAKXKdwJsv9ZoL7Zu/SwcSSeSGFdz0 WiQ9t/4tWs+U6iOYvc7TaB1LomvCQrhuaL3mlKVAADRHmp114zpHfBVGZ22zjAH+r7tL ArMlSo9oG+l4q+LgwS5lQIlvYlCYOWb6VFakO3dwSD0aehAO2IeYgPi6V4bEFcBubwhI wJSO/SCsL9gUmexPWRSi7mobeBHUAM7sQy+a622fM1nLm/UqXokvwOuCMsqUqpbx4EXK 7FjA== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Paul , David Airlie , Daniel Vetter , Sean Paul , Juston Li , Harry Wentland Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul Change rem_nsec to u32 since that's what do_div returns, this avoids the u64 divide in the drm_print args. Changes in v2: - Instead of doing do_div in drm_print, make rem_nsec u32 (Ville) Link to v1: https://patchwork.freedesktop.org/patch/msgid/20191106173622.15573-1-sean@poorly.run Fixes: 12a280c72868 ("drm/dp_mst: Add topology ref history tracking for debugging") Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Cc: Daniel Vetter Cc: Sean Paul Cc: Lyude Paul Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Signed-off-by: Sean Paul Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/drm_dp_mst_topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 11adc4b6ccfe..ae5809a1f19a 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -1507,12 +1507,12 @@ __dump_topology_ref_history(struct drm_dp_mst_topology_ref_history *history, ulong *entries; uint nr_entries; u64 ts_nsec = entry->ts_nsec; - u64 rem_nsec = do_div(ts_nsec, 1000000000); + u32 rem_nsec = do_div(ts_nsec, 1000000000); nr_entries = stack_depot_fetch(entry->backtrace, &entries); stack_trace_snprint(buf, PAGE_SIZE, entries, nr_entries, 4); - drm_printf(&p, " %d %ss (last at %5llu.%06llu):\n%s", + drm_printf(&p, " %d %ss (last at %5llu.%06u):\n%s", entry->count, topology_ref_type_to_str(entry->type), ts_nsec, rem_nsec / 1000, buf);