Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13961669pxu; Mon, 4 Jan 2021 09:04:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3/OlWY6xrRHkyILFYTNQeZirnaY6zPSIS/rqlg0bg22BNrBlRnBuhiHj2qUz+cEpWDv5/ X-Received: by 2002:a17:906:7687:: with SMTP id o7mr68623602ejm.209.1609779883836; Mon, 04 Jan 2021 09:04:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609779883; cv=none; d=google.com; s=arc-20160816; b=JsEQ3YwkktNis5LQNupogJhTC/8dmb8bd4ZgY/OYYvHTo9l3/lIgIE8owh3beH3x5v D6T4AQ5Xsppo7Rw/RrAlo9oPX7UDZ+4+Nt0eQlqLzwwgY9qtm1y0Y69qL+9cZ9z6SuEB MYa42YptG10tnByZPDEcFCTkAmuH0c+OFoAq29KzcA9pj3GfvctzpgpRDODEiPTmqmVy 0+uSzXsI/57gD89ghpFvQtLRcrw31SUMg8Un7ID9TRD5+3U517r6TK+OKdofsGCXJDgB 1Yyu8sEI7QRrQ6maGQQBU4W3LIhNaKfs2laH1uRzYl7fvBujvkPW9SwMAXDPNPGmwDD6 M3mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=bkfKIc8TYv8/nRpoPVoMEofElitz2KLsBoBEwufJSM0=; b=GoZlZ9a//dySCe50sP81uW53Ds34aNyhaUPmYTgRSWLkFbKUOnEDSQ6C4XfWenq7Z0 FVh3RdGKNo2+9SQ1sw6rZTd/jtJ/rOAtmsbLEDIzD6G4zpZEj4dh2ox46VA/b5XMzlMq pVZJIfAoFerSltk/4rJlQWLLhGbU9AwlaaIoN3pr1oZ5HTWjcNGnVdLA9vwWCOAf0J2D BbSXVceKKKDe7jGVeg+UZWTjZu35VYJdiNrybfoFv8kTwe3yO4rIG2iTNheFtaFgD2Mb yORR5luzR3d88gTMmxOw6ZR/wC6qqyDFb+4kAuKTkllQR+pCMPlNEV9O1cUjSlSoYOIs 4Q1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iGIjA39X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a18si28340482ejf.618.2021.01.04.09.04.20; Mon, 04 Jan 2021 09:04:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iGIjA39X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726502AbhADRDv (ORCPT + 99 others); Mon, 4 Jan 2021 12:03:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbhADRDv (ORCPT ); Mon, 4 Jan 2021 12:03:51 -0500 Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CB33C061574 for ; Mon, 4 Jan 2021 09:03:11 -0800 (PST) Received: by mail-oi1-x235.google.com with SMTP id d189so32794864oig.11 for ; Mon, 04 Jan 2021 09:03:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bkfKIc8TYv8/nRpoPVoMEofElitz2KLsBoBEwufJSM0=; b=iGIjA39XdTndy0R3+OqGy5LlHrdqOClBY1/FWEX5jyoMeg3HRVh87Ta21eQsaZnafO j3v/KCXJ/0iGc8LDxzKuPWravYhZk0rczR5/b6B//M+D1COrM4LDB80FALGQWNQGXMCR v0Qkxb70zsuujhkJJcLO/ungyAjilF5qjZf45da4Qb2ftbQpNpNHYMOZL0IfC9xJrCQT qXmoU38fF+1t4Hu2NraVXvCe+X3FHiTSrSdXAWAhq1LbrZTRNlFtjYICJBc/Wmb5vaQB mGxl/DIWqhVvUmpDJIRskxfFmckEGMfCz3qgS8jHz4talJtLXnj9eoq6DY88MJ2Sllaj g3EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bkfKIc8TYv8/nRpoPVoMEofElitz2KLsBoBEwufJSM0=; b=i63U6pUQs/lzNV/ofd2lGyXnY39cHOAfrudkenmS+WjUc4E4kfksja446AXXmaI/io jHCUjyqzDUg6TATbiW51BwnLTutNG9IqyOTwspwVcQYjGAJx9N6V9PYQdNawxKl56GzF gvRvTQZ+sN072TAfuwywzwGs40HfxCegMEwez1TfB1WcwVeriYcsOs2QXcFE1UCkeZ1a +tGIxNjyYUKZA4KdLOQ9T6Ctj3lmf/H5KPygKImctBLFb81mdiYaQpoRZpSNUWxSqprV P9U8aADz3GMQKtUR2RUs+JBxUj9vp+2tHCNal3yvyAL/ev3E/D0+7B0QRMwjGC+fgy0z NXiw== X-Gm-Message-State: AOAM530UwPy55VS8j91vrj/CoQIGzTSMrb7rQwFekqOsIcQ4AcPbJmX+ h8qsjYcloy8kmV7dtYNjTe5YyBStPpf+g1i2L10= X-Received: by 2002:aca:6202:: with SMTP id w2mr17652648oib.5.1609779790520; Mon, 04 Jan 2021 09:03:10 -0800 (PST) MIME-Version: 1.0 References: <20201222133100.19470-1-zhengyongjun3@huawei.com> In-Reply-To: <20201222133100.19470-1-zhengyongjun3@huawei.com> From: Alex Deucher Date: Mon, 4 Jan 2021 12:02:59 -0500 Message-ID: Subject: Re: [PATCH -next] gpu/drm/radeon: use DIV_ROUND_UP macro to do calculation To: Zheng Yongjun Cc: Dave Airlie , Daniel Vetter , amd-gfx list , Maling list - DRI developers , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 23, 2020 at 2:06 AM Zheng Yongjun wrote: > > Don't open-code DIV_ROUND_UP() kernel macro. > > Signed-off-by: Zheng Yongjun Applied. Thanks! Alex > --- > drivers/gpu/drm/radeon/r600_cs.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c > index 390a9621604a..a3aea5329712 100644 > --- a/drivers/gpu/drm/radeon/r600_cs.c > +++ b/drivers/gpu/drm/radeon/r600_cs.c > @@ -219,7 +219,7 @@ int r600_fmt_get_nblocksx(u32 format, u32 w) > if (bw == 0) > return 0; > > - return (w + bw - 1) / bw; > + return DIV_ROUND_UP(w, bw); > } > > int r600_fmt_get_nblocksy(u32 format, u32 h) > @@ -233,7 +233,7 @@ int r600_fmt_get_nblocksy(u32 format, u32 h) > if (bh == 0) > return 0; > > - return (h + bh - 1) / bh; > + return DIV_ROUND_UP(h, bh); > } > > struct array_mode_checker { > -- > 2.22.0 > > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx