Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp968156pxb; Tue, 14 Sep 2021 12:50:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAIOD4+v1I76dgP9u6VEBnGxN3yp811TottSkwoK1i0zFyZqw7d2+zJ0H5GX85VXrJYGyB X-Received: by 2002:a6b:b88a:: with SMTP id i132mr15024900iof.215.1631649046751; Tue, 14 Sep 2021 12:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631649046; cv=none; d=google.com; s=arc-20160816; b=pRGZzKCY+QOgznY929wFbw1iIyMIaIjftNoJ9BtArYUd+6khRV009fjb9eCh2RY5bD +9YlgWVHX6dULt8CJJBGKGhCqsDsRS2x7cKpTf7n1EIzdyko0LVp0rnH8wp3a6eThiuN kdeW5uuWxhmYPgZRRRJ/EeggFUlVvHcs63Ehr3Ipk/YkvBzbbNoB908kFOnVwLmBoZ8r IRhILF4rHDoWy7tqvouegnMGOJLy5PXsoMHRxe2d4XLxaQz1VAd+Zgvug27ySgEChfBi 1zmXZL339z7ZDmKF6dymrdk89stl+rSDNXNvZxsce5E8Gb1E237n1/Gk8uCApzwiDmRu RIbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=F6PsShm2+LtRfF7zvUBuZb6sWSvD0FefZC4vf11za4g=; b=zMG+Dr7Lfl1FfTIo0Ac292MTiK/SwQeuujNjn4/HzX+6JSa3m11nHsDNvuUt2KirGm JOh6pvEQRoqJLExE5y2NMAhwcsrX9qTrLhlp+26/YhQsHo11DPJgokAtc3OMifi0CfFr WjXFJEnNudjxN0IYPYh7hIpUCVf2c6LOMaDlwOyc3/2d6XdnVXTLJWOWwu+oo3p3E7SG yo0nX/l2hUIlmCmVPM3NV9IXXc3C5YMWwQlQq6/WPkfMYFVSpo3XkjVxKQ1Ffrwaoits QOOj/PlPQ84+afHOlPZi2BW3KhO45MS4PHow6h4e7fiuYzK2RG6+w/9qXX/2X4Q/87Tm R7LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ftEVYmXt; 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 l126si9868346ioa.77.2021.09.14.12.50.32; Tue, 14 Sep 2021 12:50:46 -0700 (PDT) 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=20210112 header.b=ftEVYmXt; 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 S232716AbhINTuC (ORCPT + 99 others); Tue, 14 Sep 2021 15:50:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232265AbhINTuC (ORCPT ); Tue, 14 Sep 2021 15:50:02 -0400 Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 413A0C061574; Tue, 14 Sep 2021 12:48:44 -0700 (PDT) Received: by mail-oi1-x22c.google.com with SMTP id bd1so812099oib.5; Tue, 14 Sep 2021 12:48:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=F6PsShm2+LtRfF7zvUBuZb6sWSvD0FefZC4vf11za4g=; b=ftEVYmXtzBqtgPMuCUQK92nlXhVyaFSoDT+bYIlkiiKIMvqDadH4mSO1dIERn4gEEd +mCNnBQyYzd05jfVb6q5g36anr9co8J9dyiiABNwHw03o68G4BNeRVVNhDFroiB76Pgy J9A7KrlRcXjhoqiXdv1Kacuqks5rjrufLzjT6YSXt1n6aKj5bd00EqSTswj2YCnmYyu8 bW7q4vl4/62EpYskk3Y/MHbVEmrMLV0C78/i7u8ArT7KrN2QqJXDvr2CfH53djfockAA XLbEolIWFIhVJgWPc7g1czGR/DoQRyuLptt1gjUjQ0oOcr88ArF+pixVCFa3ZXU63rrw e3hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=F6PsShm2+LtRfF7zvUBuZb6sWSvD0FefZC4vf11za4g=; b=X2rAlUbI9We4jqvVuGtAvHM91aJXP1obmZ36N9Vz1WDZOgio4PWRzrOjENdjdpfwjL ZGizX0iCnYqytnAJCXf5YNud3M2Tjq/6PV88/VESAauTmy9AYcSsX5sf2tPUHDpp0C2l KFygTYKdKruE6PmaodkUteonhbV39zdif+eEiIFd88k8Ph8douah3V+i/eZtXsxinVPD bACEvK/JRbTPbsMljfxZJxL3bRhEpzP7nX0aXM0t4eK+ii+5Rj8LqMvSz0wh+BagXxZ8 AljFZVvbflCP3Abj9IE/EyxSTdjRpNGc6mrm98ukSLGdvzGJHBgQafjqj3jFuWaQEf4+ btRg== X-Gm-Message-State: AOAM5333wBg64sndmJqyHbKDGkaufY6jatPIo7Ssj3QZLfWjWl16AS4E mtV8Cw/Cv6ssahjW62ppKIRo5Imp0RPR8Nk+qAQ= X-Received: by 2002:aca:ab06:: with SMTP id u6mr2676900oie.120.1631648922227; Tue, 14 Sep 2021 12:48:42 -0700 (PDT) MIME-Version: 1.0 References: <20210907100302.3684453-1-ray.huang@amd.com> <5e365947-4ae1-47a0-7565-7f0cdde0bd84@amd.com> In-Reply-To: <5e365947-4ae1-47a0-7565-7f0cdde0bd84@amd.com> From: Alex Deucher Date: Tue, 14 Sep 2021 15:48:31 -0400 Message-ID: Subject: Re: [PATCH] drm/ttm: fix the type mismatch error on sparc64 To: =?UTF-8?Q?Christian_K=C3=B6nig?= Cc: Huang Rui , Daniel Vetter , Maling list - DRI developers , Linus Torvalds , Guenter Roeck , LKML , sparclinux@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 7, 2021 at 6:25 AM Christian K=C3=B6nig wrote: > > Am 07.09.21 um 12:03 schrieb Huang Rui: > > __fls() on sparc64 return "int", but here it is expected as "unsigned > > long" (x86). It will cause the build errors because the warning becomes > > fatal while it is using sparc configuration. As suggested by Linus, it > > can use min_t instead of min to force the type as "unsigned int". > > > > Suggested-by: Linus Torvalds > > Signed-off-by: Huang Rui > > Cc: Christian K=C3=B6nig > > Reviewed-by: Christian K=C3=B6nig Is one of you going to push this to drm-misc? Alex > > > --- > > drivers/gpu/drm/ttm/ttm_pool.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_p= ool.c > > index af1b41369626..c961a788b519 100644 > > --- a/drivers/gpu/drm/ttm/ttm_pool.c > > +++ b/drivers/gpu/drm/ttm/ttm_pool.c > > @@ -382,7 +382,8 @@ int ttm_pool_alloc(struct ttm_pool *pool, struct tt= m_tt *tt, > > else > > gfp_flags |=3D GFP_HIGHUSER; > > > > - for (order =3D min(MAX_ORDER - 1UL, __fls(num_pages)); num_pages; > > + for (order =3D min_t(unsigned int, MAX_ORDER - 1, __fls(num_pages= )); > > + num_pages; > > order =3D min_t(unsigned int, order, __fls(num_pages))) { > > bool apply_caching =3D false; > > struct ttm_pool_type *pt; >