From patchwork Thu Nov 3 06:41:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 14678 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp356978wru; Wed, 2 Nov 2022 23:49:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM63tGmzSEG65P0Hj0jlVFc4iiS3No0OKcy+Kh7QNP8Xfs+wCBpDE11VCYy4vXKSEne+A77e X-Received: by 2002:a17:902:e88d:b0:186:f9d4:3fc5 with SMTP id w13-20020a170902e88d00b00186f9d43fc5mr28780705plg.116.1667458176701; Wed, 02 Nov 2022 23:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667458176; cv=none; d=google.com; s=arc-20160816; b=fwib3s3740D5Bz1Q30PP0p1nJ0MURghCHbp5bEEPVRtsTVSpx1EyJi0Gw3vPGKs74c AlpJayJcS+L+o+et27YovPllbjFRYky73gVzYdeokH5nuEndwF4rwWwVjGe/af5GMUet 8P8Lz2PSZrsmPQAQ6XT8H2AeqEWVEAPa4JoyWDNOl3BFQZanblDezAF504CGBUGf+9Db eIsCdAYCr7TIFF3qRHmn1HW/3b1oKIQBarZnnbilW2E8+r4wsqAlNdxqmJskDIE3TqP5 XX3yer2mp2yACzqUILtrJkaiM8T2/Y8SZF5US/3T8dqFjHkV199vYRMYamIya+obagB5 ySiw== 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=cbVoDl1bgAHorQLr3vzNCOgK6U1WBWAwctO98XmDjWI=; b=fKfcVPr2BPjOyxt6oEz6aH6LTJjTL+VmSZZLBwKUoY6kgRRD+5XRO1rVc/rcCtlrRq 0wgp6T22vzFbHeFXsHW3a6nY+U5NVCzSziyTMgMZ5QNBWiZwKcRAHALdYUVlFVA2Ey++ texdeXVOJbGgYKaRgp7+hX4tWJO5em++qfn0moVvQ8iUocuVQQRO1cTmpmDSXKKnGkzy 7T4WsB7S0qrNqasq8BOp7BC7LnGlOHDNF5Ll4gh9YkuD+iXhQuG3W5iS+51ECdQC1wgA OwooRYRKPjF3psyp7QMCuH46G1U3veM3hTxBsPr/ew9MPsNfJC6sustR/c2qMsoZJ/Mx 7ZGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd12-20020a170902830c00b00186a2274394si15807352plb.476.2022.11.02.23.49.24; Wed, 02 Nov 2022 23:49:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230489AbiKCGlj (ORCPT + 99 others); Thu, 3 Nov 2022 02:41:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230513AbiKCGlg (ORCPT ); Thu, 3 Nov 2022 02:41:36 -0400 Received: from smtp.smtpout.orange.fr (smtp-11.smtpout.orange.fr [80.12.242.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D314C6159 for ; Wed, 2 Nov 2022 23:41:34 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id qTuto9Kl2Fv0OqTutoMxwL; Thu, 03 Nov 2022 07:41:32 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 03 Nov 2022 07:41:32 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Nishanth Menon , Tero Kristo , Santosh Shilimkar Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2] firmware: ti_sci: Use devm_bitmap_zalloc when applicable Date: Thu, 3 Nov 2022 07:41:30 +0100 Message-Id: <43ab1a7dd073d0d037d5d4bbbd5f8335de605826.1667457664.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748456624942670298?= X-GMAIL-MSGID: =?utf-8?q?1748456624942670298?= '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 Reviewed-by: Nishanth Menon --- Change in v2: * sync with -next * add R-b v1: https://lore.kernel.org/all/1bd77909ff75f62a2228a39db208c4c6d1b3e0e2.1632659746.git.christophe.jaillet@wanadoo.fr/ --- 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 6d2fd0ff7ff3..039d92a595ec 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -3398,13 +3398,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++) {