Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3109326pxb; Sun, 26 Sep 2021 05:39:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXrwH3Vn2cH1dWwhI8kcxAbVCWlykc+4ly96l/sMTTCUIF9gmBTE64oQs56gAUPXRvLCIP X-Received: by 2002:a92:ce05:: with SMTP id b5mr16308929ilo.194.1632659968789; Sun, 26 Sep 2021 05:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632659968; cv=none; d=google.com; s=arc-20160816; b=hw/BN+Oc0Otk/hIkCNjntACseDtzMwrYjM5OEjnMUXZYGsHbSHuqyhRgvnNEge4Ahj y+P7vWr0kPQMOo/V5DriJUjT+oQ2rQ7EXropgKUXDQha/luFzonsoDeW66kiLt78BDLN 4B/hLIqokqCw9SiUwQPHQhlX3LZz4m5JKcy3oAPFfrxnmjxnwgVI68KIIe+PFNC5+GmI uehU8S1EJRXVH1pz9613CuVVPklxoZBb6QfL9YtGQvNJdzBm5QF9WFptbZLqnbTDg2Ty pHmcyPoBC9elEovsXgHZSWHYuQYzNjvFRMO6G5c0CBKVZ0drnQ81qQVD1WK68FXyqXZr rZrw== 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=TY+c6PZRhWo4raSACdSD7PGPXnNd4VU5H90V3FxjaAQ=; b=SiIYo8QDKG5A47kyUA+sicpxsyA0VVGCzKPDmlWiQkk++JMn7WI3U944NI9OUT+Ofz 8c31uIWPwmwW+WnAA2pEF4E1QrfL1tzy5oHf6RvHCYKjzRRXja3YybXUmMjVnMTWsK/x CYXwpvIo+JG8/JG1fGbVQo79LMKaN4tHP5luGVxGZGXysC3leC9aJx3FLaog5yhoCkCX 5zJOXTD7WuQPbXYvpDHaYhMBA2OCmFS35PSRJdjpFCszp4K/H0PheWUXRuCFRlvvRIOS yBo2RG76uAip8ouhjNfdKnUIii17y3SqkQTdAB9TmkaEtNjeTiVqI09hKIRy6gtiKuJQ PObQ== 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 189si17380863ioa.5.2021.09.26.05.39.16; Sun, 26 Sep 2021 05:39:28 -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 S231416AbhIZMjJ (ORCPT + 99 others); Sun, 26 Sep 2021 08:39:09 -0400 Received: from smtp09.smtpout.orange.fr ([80.12.242.131]:30641 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230160AbhIZMjI (ORCPT ); Sun, 26 Sep 2021 08:39:08 -0400 Received: from pop-os.home ([90.126.248.220]) by mwinf5d33 with ME id ycdV250084m3Hzu03cdVkC; Sun, 26 Sep 2021 14:37:31 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 26 Sep 2021 14:37:31 +0200 X-ME-IP: 90.126.248.220 From: Christophe JAILLET To: nm@ti.com, kristo@kernel.org, ssantosh@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] firmware: ti_sci: Use devm_bitmap_zalloc when applicable Date: Sun, 26 Sep 2021 14:36:55 +0200 Message-Id: <1bd77909ff75f62a2228a39db208c4c6d1b3e0e2.1632659746.git.christophe.jaillet@wanadoo.fr> 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 'xfer_alloc_table' is a bitmap. So use 'devm_bitmap_zalloc()' to simplify code and improve the semantic of the code. While at it, remove a redundant 'bitmap_zero()' call. Signed-off-by: Christophe JAILLET --- drivers/firmware/ti_sci.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 235c7e7869aa..a33eb884102f 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -3352,13 +3352,11 @@ static int ti_sci_probe(struct platform_device *pdev) if (!minfo->xfer_block) return -ENOMEM; - minfo->xfer_alloc_table = devm_kcalloc(dev, - BITS_TO_LONGS(desc->max_msgs), - sizeof(unsigned long), - GFP_KERNEL); + minfo->xfer_alloc_table = devm_bitmap_zalloc(dev, + desc->max_msgs, + GFP_KERNEL); if (!minfo->xfer_alloc_table) return -ENOMEM; - bitmap_zero(minfo->xfer_alloc_table, desc->max_msgs); /* Pre-initialize the buffer pointer to pre-allocated buffers */ for (i = 0, xfer = minfo->xfer_block; i < desc->max_msgs; i++, xfer++) { -- 2.30.2