Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3174048pxb; Mon, 24 Jan 2022 04:13:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQgWPX1eHOgBDI+niyjdhMEhoz8vPNeiNKdIY19Pp0cGSz6+Q9fiVUe5PRRFVLUybtdwib X-Received: by 2002:a17:90a:8b95:: with SMTP id z21mr1624385pjn.29.1643026379853; Mon, 24 Jan 2022 04:12:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643026379; cv=none; d=google.com; s=arc-20160816; b=TNXqNkTHPnZtYVqf8AT0pUJJWmq1W2T+8EuC7k9VnIbOVDBJ/+pBucuODzqiWUoQpg n33zbuzFCZAnBmX7xv/YToD07SqV+ycdyrghN3TH3PfdsJcaia7bN28GmS6c9orX/rT4 7iXM5De+MrE1dn73vZdNCGOTy3fPGpdhUmi5Xs9NrMh1y9wOa0rNNhRZO960XP5EWQcS gvOkzFH7tPK7ztaciTiEfzNpnPXNqjDOu8OJMOQswjSGdvaotbSTpvxIrc4l46CJz/Ye VDGm16t19EkbeBIqu28QVWu7FyphQvYUUDdRmGEdiv5ZJsE8uTtfVTmg+D/eS0XQ13V7 B7lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=5dgQylvVki0nkzDnS/+Po4tisaRNHjVIflYn4fyQ95A=; b=wHBnvp2ApElVi55TLhbofO0FYKBfl/rmvmLFr2y3L+eODpn7WCpTorhnhYnBX0qmMS ELop/8mEFJvv0d+h5jiBqIpzI9ILcfSpJsJXQeNslrQPWq8g6Fwbkfy2NuB4+5PvOIal ZSUCr/KrP7nWRZjWITnzwnH905oYZkPp0bi+y69gQuL3pLJoKhQL/oMQ75vhuVJ+JNVD 5fFa5yKNBk7kAZikxMnDFpvgvckZnpOwcZI6UfW5pSaPJBUjo8V/5C+ZXt9/IkjUF8V+ HXeZ1Dv8dfDoRDcVI846xGB/gvwQ9Ffq1IozS9rsUKWMXBYooYGKxzV+12GM3Hm+K/z+ hF0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NPOFz183; 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 oa13si21139517pjb.49.2022.01.24.04.12.47; Mon, 24 Jan 2022 04:12:59 -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=20210112 header.b=NPOFz183; 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 S239731AbiAWSk3 (ORCPT + 99 others); Sun, 23 Jan 2022 13:40:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239638AbiAWSkM (ORCPT ); Sun, 23 Jan 2022 13:40:12 -0500 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F200C06173B; Sun, 23 Jan 2022 10:40:11 -0800 (PST) Received: by mail-pg1-x52b.google.com with SMTP id h23so13121408pgk.11; Sun, 23 Jan 2022 10:40:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=5dgQylvVki0nkzDnS/+Po4tisaRNHjVIflYn4fyQ95A=; b=NPOFz183ei2daEpofKHSZlIolbNFGvjJd0bvuAgxnQXa1mbuzsB8hvhkTyioW5ltoS y5sMMuWjyvc6kDKU9Jy9RUasJPQQydggdGhHkwIb35VXWo1CaSQ0zCd9mdEPpwTnH9lE TQqSWzrtUY0GJOlgUr5T7TRU7USi2tfNg0iPTHfbRBNkqvnNmL37z4Z3nE/duk/GdyQ5 cmvTi8PRmdLMbpY5nfSMCDbv/xdK/q2iKEIs8W5TKJvzZ6qlATNv/wm7uCbiAn1dPBU1 +aM82cX+6IPqeayXYKuA7LfBX8rP3SzfEyhASY6EF68X1T6Es8PNFrBgcehKUkL4wkcD DEnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5dgQylvVki0nkzDnS/+Po4tisaRNHjVIflYn4fyQ95A=; b=C1XnGtuLZ+5b+jIpOZs8MkATAvPQ8EfJaC9z5s2FLWazeDtrPzD6gsXUmVACzVD5iD wOlJTT0C24+OwJPhf+xdAXqmVtWgi2ZKhVbt0mphnHRb5D0LaO8Me9g9wrDp5KX+nxPF 8QQwkas0RbsxMUINecOQJUediEutlqfByXCscoFJCF2rt3Qjj5ywrDNpTlclv8ZavaFP BrkNxGXCIQ1KqYH5ffVB4A1jDiyhWiKgfzzn0yQeB3/yRR1KJcYu3sz3y4Latirfu9Rt sg69Cb+5i0APwX31C5aQ6+SdXepuT9r+RJDeSBXhOADiiRW4bLuJ2bQti2+jH9zwC3B/ J1yg== X-Gm-Message-State: AOAM531AGLPoGrgMg+bghXOb31wb/ViO1NGjg5EbTC0EAUllEVJUoJJg l8RRJPpQjWR+kBuaDu2hwz0= X-Received: by 2002:a05:6a00:23cc:b0:4c6:d3b8:29ea with SMTP id g12-20020a056a0023cc00b004c6d3b829eamr11191897pfc.78.1642963211024; Sun, 23 Jan 2022 10:40:11 -0800 (PST) Received: from localhost (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id a3sm10460879pfk.73.2022.01.23.10.40.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 10:40:10 -0800 (PST) From: Yury Norov To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Andrew Morton , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= , Greg Kroah-Hartman , Peter Zijlstra , David Laight , Joe Perches , Dennis Zhou , Emil Renner Berthing , Nicholas Piggin , Matti Vaittinen , Alexey Klimov , linux-kernel@vger.kernel.org, Rob Clark , Sean Paul , Abhinav Kumar , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 07/54] gpu: drm: replace bitmap_weight with bitmap_empty where appropriate Date: Sun, 23 Jan 2022 10:38:38 -0800 Message-Id: <20220123183925.1052919-8-yury.norov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220123183925.1052919-1-yury.norov@gmail.com> References: <20220123183925.1052919-1-yury.norov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org smp_request_block() in drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c calls bitmap_weight() to check if any bit of a given bitmap is set. It's better to use bitmap_empty() in that case because bitmap_empty() stops traversing the bitmap as soon as it finds first set bit, while bitmap_weight() counts all bits unconditionally. Signed-off-by: Yury Norov --- drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c index d7fa2c49e741..56a3063545ec 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c @@ -68,7 +68,7 @@ static int smp_request_block(struct mdp5_smp *smp, uint8_t reserved; /* we shouldn't be requesting blocks for an in-use client: */ - WARN_ON(bitmap_weight(cs, cnt) > 0); + WARN_ON(!bitmap_empty(cs, cnt)); reserved = smp->reserved[cid]; -- 2.30.2