Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1803460pxb; Wed, 9 Feb 2022 05:00:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyeynssCPxDoUhi/s7jZSie4KOb/EfRK01A9XNDX1XSjBxcLb8qOKDLt9OOdotK7KhqFp95 X-Received: by 2002:a17:902:d88f:: with SMTP id b15mr2309205plz.44.1644411657418; Wed, 09 Feb 2022 05:00:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1644411657; cv=pass; d=google.com; s=arc-20160816; b=rQZMkh7v/rSpNp9vIhOoUR5BV4jMiNEJXlMIUHItgwYUUG6KCGD66YXpTiwP2dDpvZ jX/Zhv9R0l7VyKLaSRUqLS3bUQNlgVAL0erZvFo69263gbyAJ91OgxyVGDfpwm3LbKHW /g/oB9z+txQHQ3CfOxgaSrAtcZanUQVXSknbqoy6zgCrGqJxlvn5aRQHccrkFHqQysud poa6qjCBpWXDzOI+BApXaSmsY9bJtXxkaaMGg+0/BDfqueBWbL8g3prH7ZoI2D4QjX2S D1xk5zwLcozIZdKv9xaEho9EC1oEM6wsfW8gcu6r/0Q2PnTna52gXeI8msFy9I2xLwO7 NXEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=Fy1pirMYwcJbp5qsalfXm+LghMjolsmI1AScfV6O3Pg=; b=Jh5yQAVXVvlKOhquH55PRzOmFIxn/7n1HmO1FkBLv7NOikuOd2KSeYilgk2/ytC4lM +fVEtmbwzcNkg7jU40XMYggH5iwcw9mTQJB86qDVx9dT2aII3if4zg8UeQmJDNxSSLd/ Odk8T4Oq6s5bCqWwgL/3by06R6kZJXqKFf6jDZ/1fDqDP1LHZ/NKqyVoA4NZgjew1kf2 k68YE0RnUeaMDXYnRQdtTH7or+DSTQB6/LzCJXp6eVX6LMVb4d3D9XAdQKCHUgnaQkZZ L1cFR2OHsIF0dJObtU9NraXFdNXyodoqI/FToPfYnIP7S0CEEs7jDqX9CZ/zBaYyMQky mmjQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo0.onmicrosoft.com header.s=selector2-vivo0-onmicrosoft-com header.b=St0mVUG+; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vivo.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z5si14468173plk.433.2022.02.09.05.00.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 05:00:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo0.onmicrosoft.com header.s=selector2-vivo0-onmicrosoft-com header.b=St0mVUG+; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vivo.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AEFA0E16FC8F; Wed, 9 Feb 2022 02:33:55 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240399AbiBIIqI (ORCPT + 99 others); Wed, 9 Feb 2022 03:46:08 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:45984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242489AbiBIIp7 (ORCPT ); Wed, 9 Feb 2022 03:45:59 -0500 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on20706.outbound.protection.outlook.com [IPv6:2a01:111:f400:feab::706]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BA78C02B64C; Wed, 9 Feb 2022 00:45:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iLsXvINHlzcRhUtQC1qlH3cNGs1wFhobVdQ+qC77ElAtc7knT3IuM+ggVyOTzIJa0/ikHH3kbZYL0MjVT/7ivkySlj739JSc2vWhkiftP7f6/c+boLTQ7lxoxaTRSuWq13NqGawSewYLDb2WhREoEGv8Mz0TmpuefRNFiuqvRra3suW+iGeRjQA44fBjrF5IqINOsftJtf5IT9biY39gSBMwWOZKCQKxLS3pvunaA+j41sD7qs98XxAqXMk0uvaFtxM82vEFxCBfhn+yj7VTymZ8kmubev1JrhJCYINEiQGPlrU0l/fRQKm1mtJZeyVlH9Hu1Tb6FRG2KojVpLTXIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Fy1pirMYwcJbp5qsalfXm+LghMjolsmI1AScfV6O3Pg=; b=PO09So7MWbZldw++OlGrtJZFf77jBmui+cIrpwXeDDkICzXMjP7HntPIQbGjENyGenKQsfD7mxiEFdFSOPjnrt62CnD8mpmxSFj4dWR1vpm6Dbd5lQAxSzU/JDSng2XQmLbFy9K7FN8CojkbS03q4x5Ahk111dg47x+KJY63G2p5Srwdxl6zKdTM/mdAk48ymUBLVtbJwyViYrNOkwWLLaMqaX7IwfdjFDSryblH4ViFamgfQEw04NIiGnyTG2EvuaM1EBlBn2bApjGRy2zFLh7kYxMII6RSUBTPitBscbsNuyr7SDtjmAeADKaGZZz7J04ptfNdxerjVKK6lUhCZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Fy1pirMYwcJbp5qsalfXm+LghMjolsmI1AScfV6O3Pg=; b=St0mVUG+slmIIDZDJnq4v8xz5hZQ3HGaF0EDxXJjvph6VP6VINKxBNsvSi8s9rJlfhFM+2BgbT2oTqkAP4MO0o3/Kb7q3/ptrPoSHAQgY+xf7S+TfyYmZMgunpMkorC4PugIN5BWsFlJ+X0vwnRkqkamFYA5cdYt4gOzct2J+7M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SL2PR06MB3082.apcprd06.prod.outlook.com (2603:1096:100:37::17) by PS2PR06MB3559.apcprd06.prod.outlook.com (2603:1096:300:6b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Wed, 9 Feb 2022 08:37:25 +0000 Received: from SL2PR06MB3082.apcprd06.prod.outlook.com ([fe80::80b4:e787:47a9:41bb]) by SL2PR06MB3082.apcprd06.prod.outlook.com ([fe80::80b4:e787:47a9:41bb%4]) with mapi id 15.20.4975.011; Wed, 9 Feb 2022 08:37:25 +0000 From: Qing Wang To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Wang Qing Subject: [PATCH] gpu: drm: msm: use div64_u64() instead of do_div() Date: Wed, 9 Feb 2022 00:37:17 -0800 Message-Id: <1644395837-3845-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 Content-Type: text/plain X-ClientProxiedBy: SGAP274CA0006.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::18) To SL2PR06MB3082.apcprd06.prod.outlook.com (2603:1096:100:37::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 27d35d51-edd8-41be-a475-08d9eba765ea X-MS-TrafficTypeDiagnostic: PS2PR06MB3559:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5gWAT3H8xFFuQqoUCX3iu/whfkJerl5Fq68j1PnAe2F8zx2kuterMK/cQJBJVrVMv2YL9rNsAGa6rVIFSobKvuKv5MLPMrEeGYRnroudhxEicP/n2bjDc6Za+3/8v/tqVFKcC4+L4BTt7S7HD8rGBsXeUBZ31b1txCxGzDvO5oiZcpMAMMZ+XXScHk4iZfZavG3dxdiGTd+6BkEePVX9+OwybcpDVi4IhO+CPGrCrlPY/vScHGW/HVVL9MfhpgZ+vr7A1fQssqZpszMzLdjkjcZmK5WmOc2GSPneFChbpCnmcnUDaCvv4CrvrWqngAJ1mYlh/7FAoOs7wnmk3k8DxCp3UgNmm+sAETU+36hg7exlO/2bKTDudUM0731fS1Bd+gAPB/f+X2+sf+8zfOU0azP+LTmlTzpiXPRQpTO0Zl+vfzZeR9k5J56ra8sit91PAHr5eX8sJxXCwR3vWecwHAitgB0gHDKGycAO1GAs4EqWpztyJLIfDTn/6gUsW6kn/K5+qt3WYfK/KBmhPPRfsZOArlkyrKyQQ7eR0uG7RyVOyy/MGsianVMMxfWKHI9irg95NFQO+/dh3kA18g3s6leL/V1PMbTJCY6zqqfQKz2tFSgFhREi0+E2xMo8xRxVte283cDPCwHmRPLC71UAhMK07vtrZ+UsqRt25oI1Z36oa79LRzoJI65GL0Gq7rR5tA3yjE9k0GqoxD6SxhrCvA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SL2PR06MB3082.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(2616005)(8676002)(4326008)(66946007)(66556008)(66476007)(186003)(26005)(6486002)(107886003)(6512007)(38350700002)(6666004)(86362001)(6506007)(38100700002)(316002)(110136005)(8936002)(52116002)(4744005)(508600001)(36756003)(2906002)(83380400001)(5660300002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?p7bICybPQ806gzeBzsIlC5jH2n9rQ+WJTE7a+KMHJiKXr9trv23w1EzrvNG7?= =?us-ascii?Q?fMttR4t+QM/DHKDg7W5cikzRqJKXhFL+p3WsegqEN7PrroC5Hv9TE491AXtW?= =?us-ascii?Q?DoMhv5b+NOjROa7ERfJ0+6h7OPQjrPwE1HfinkALnOpytJw/857A5npkKpKR?= =?us-ascii?Q?oxyqoyWsqsNSxOAbQl9qy1LVmYljIq9pG/AhHG1T0X+W6/yAWP4b6wtF1Fdx?= =?us-ascii?Q?viF7t9rFQfCV5/lMDU44o52CXnxhFmTa0CxHniMVtt1YgBtRWEyakhV7k/RA?= =?us-ascii?Q?91hmo4PGA/KvuFUWWNxXGHE+BsizUapjrcg9aAGaVc2sKY5DS85+asP3fkoz?= =?us-ascii?Q?Zga+25QVSnoxrhb3kKyThBm5SxT5QWN15SblPCLTbMnawIKZz1eiqUPZX5I+?= =?us-ascii?Q?4JKxh9chLAktc5ROJIFKkJ5dVtq5fbnJUjDl8vWuh1SvepN+EdnWoS4SLr50?= =?us-ascii?Q?IHyhArSf+v4/o1Szscld3UhAa9lYrxautkBmEZuhRRwQ3Q/Gw+uqO8SlWRG2?= =?us-ascii?Q?jhjB7kn5Ut9nZFzSmdRzGOHZV0nehzyLGNOqYVYX5JV8hmnVOJ/VK3qflu7y?= =?us-ascii?Q?luzaOwoiRT2bBhBZpU0BuBqQpLeovpHXbu5v4V0sn9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M8PmEmG5iavHbF5Wy9/G8d+Ndadcly1upxglu2iGknQaOopY8y?= =?us-ascii?Q?g9WrkR76/aIWA4AQaZQTqFnqQC5fpyJMFCvMBdS1Z2Nzx50WO2XDbW7OrO9J?= =?us-ascii?Q?ZLS80N2Sg9T2juplfCBKugk=3D?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27d35d51-edd8-41be-a475-08d9eba765ea X-MS-Exchange-CrossTenant-AuthSource: SL2PR06MB3082.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2022 08:37:25.3452 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eDv6QqhTuxOIJ29k9+GlOwFPGrEE6Kb97/11tmvQjZPEVuyrtOAB0cML46OtwRc4IpejfIJ4m2bfTQ/t0yNGGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS2PR06MB3559 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Qing do_div() does a 64-by-32 division. When the divisor is u64, do_div() truncates it to 32 bits, this means it can test non-zero and be truncated to zero for division. fix do_div.cocci warning: do_div() does a 64-by-32 division, please consider using div64_u64 instead. Signed-off-by: Wang Qing --- drivers/gpu/drm/msm/msm_gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index 2c1049c..aa4617b --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -648,7 +648,7 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_ringbuffer *ring, /* Calculate the clock frequency from the number of CP cycles */ if (elapsed) { clock = (stats->cpcycles_end - stats->cpcycles_start) * 1000; - do_div(clock, elapsed); + div64_u64(clock, elapsed); } trace_msm_gpu_submit_retired(submit, elapsed, clock, -- 2.7.4