Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2970960pxb; Sat, 23 Oct 2021 12:26:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3PX/PK4lFVDkTA0DcxzAzfLGXRRYLdonOLzPq2vcssgLHgJR/e41IgMrJ0ru6y0PwRdjI X-Received: by 2002:a17:90a:d801:: with SMTP id a1mr23050781pjv.58.1635017205502; Sat, 23 Oct 2021 12:26:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635017205; cv=none; d=google.com; s=arc-20160816; b=BSA7iYB4bPRedcyohB43nLuICFTTlD4bVVC5+0OMEm7MkzxJAQc132Irw/N6ftyybP jUDg7RtUIkROZLvZXqDeQkiFKo9+XzdGvqmf4BOuu6olbMynr5CPpG4/dhx8aUwlZpEL YdT/HIG0vvh9nYH1351oKs+N2YpQIjp7O4zorEzF2H+LkG4EHKjukOiNUIysXKxHk5fe eLBqkBLedWLotN7QboiG9kaJVtI/UjohM/Sk3cq+caGszY7cB3n4jNJyqTf3wqQ1BkGn JapLGo+b7CqToo4odbCgo8wOWYIOpRqk1NcTRh90mssDe+pA1yASzYaJYHO4F0c8X2YE 5UKw== 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 :message-id:date:subject:cc:to:from; bh=togk0u+6UuALNOIw1AR10vxPF3svfcikyRWyoUpOe1g=; b=cWiFvdPybcTiC9lbDEf9Lv/ImFZKqvXGvYje/qlRn2jp9V1JdqDccCewru+hKvv9Rm 0jGPdZhekugkmhdjy2i9TCcoh3bW70mybXEa6hVxhzVkQxg1U9X7YcV5BJiFPI02wsSa MjhdBAuJs1AwDqxCH/TlDnMX5uUKezIqFJoD9ldWGrnB9obTUl5haYmBDBC40W1Pwdeh VDvRYLaPmN3aYSvQMy9u26W+bpH2rOnuI4QiwogARu6e4uUQxY6w746sM5iUE1M9mBv/ zr04zuUw8zI/lu7DnLhsp70RMAhelsvvYYQJIKue/ems0TzLEbavAZTZ23+2EY4mwZUr VgQQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si16059141pgl.430.2021.10.23.12.26.32; Sat, 23 Oct 2021 12:26:45 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230463AbhJWT0w (ORCPT + 99 others); Sat, 23 Oct 2021 15:26:52 -0400 Received: from smtp06.smtpout.orange.fr ([80.12.242.128]:54587 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230266AbhJWT0v (ORCPT ); Sat, 23 Oct 2021 15:26:51 -0400 Received: from pop-os.home ([92.140.161.106]) by smtp.orange.fr with ESMTPA id eMcymCjNuTdRTeMczmKM3J; Sat, 23 Oct 2021 21:24:29 +0200 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sat, 23 Oct 2021 21:24:29 +0200 X-ME-IP: 92.140.161.106 From: Christophe JAILLET To: mathieu.poirier@linaro.org, suzuki.poulose@arm.com, mike.leach@linaro.org, leo.yan@linaro.org, alexander.shishkin@linux.intel.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] coresight: Use devm_bitmap_zalloc when applicable Date: Sat, 23 Oct 2021 21:24:22 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'drvdata->chs.guaranteed' is a bitmap. So use 'devm_bitmap_kzalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Signed-off-by: Christophe JAILLET --- drivers/hwtracing/coresight/coresight-stm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c index 58062a5a8238..db9eada24275 100644 --- a/drivers/hwtracing/coresight/coresight-stm.c +++ b/drivers/hwtracing/coresight/coresight-stm.c @@ -862,7 +862,6 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id) struct stm_drvdata *drvdata; struct resource *res = &adev->res; struct resource ch_res; - size_t bitmap_size; struct coresight_desc desc = { 0 }; desc.name = coresight_alloc_device_name(&stm_devs, dev); @@ -904,9 +903,7 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id) else drvdata->numsp = stm_num_stimulus_port(drvdata); - bitmap_size = BITS_TO_LONGS(drvdata->numsp) * sizeof(long); - - guaranteed = devm_kzalloc(dev, bitmap_size, GFP_KERNEL); + guaranteed = devm_bitmap_zalloc(dev, drvdata->numsp, GFP_KERNEL); if (!guaranteed) return -ENOMEM; drvdata->chs.guaranteed = guaranteed; -- 2.30.2