Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1470447rwo; Sat, 22 Jul 2023 14:26:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlEDr1qGytoP93IhzirfSLnH9E3Uzf5awCbXXc/gmuHLHsDtD7GxtsRCv0ENo5D56EfqwYYp X-Received: by 2002:a17:906:2096:b0:992:42d4:a7dc with SMTP id 22-20020a170906209600b0099242d4a7dcmr5272375ejq.21.1690061200980; Sat, 22 Jul 2023 14:26:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690061200; cv=none; d=google.com; s=arc-20160816; b=CoBq65AeYW2vLlGqu/0Lq+UuyuS3a1+daT+f926o7pHDCbovd+KwsTdJ9VOlR/bNM8 HOpsV3rqXcKNUuivWw4oOQ7ttd8w3LDxBWNE+rWFnjdP6r1tSaD5ojRfaIwFeoyvs5A8 AD3RzjTHpMoBqopIUNhTNjUqgrRXVl49hdZD2M2FyaY/70Hf/5dkLEbWB8LwVw2Ge1jI 7/lRMJn7rfeLQoxBxYFVU+9TiW2NqFS0mCR6TsLfkPeDnvbQsZE3vFYP9y/hdwAL2R+z Gn+CplPZOY3ULYjpOfI0XJumIfcHff6ngfkzZCrcxPdPxbr7+izcDHYnFNG/e/vJRbo7 stPg== 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:dkim-signature; bh=/NfZHk2r0r5O3/cXEnU1+UoN/5FO53TePxKwYDuLCpA=; fh=jrZ7NBnEEPKdLtZRNHvuzU+hcGWNWXkVKPQ68lw0Drc=; b=F3m1ox0uZFEGJMsIqFH7CCyZyKiGyd92JaK9w0SxoDcXS85Gx2ztzxo4x3GoDEiB0k 4bZGIgNnFYKXQc5P91myh1OdIN4cZlwZJsOmPliq341hRYMF0Z596JL5dxjwNhAXKjoy g0FppD551EdLyooivTxkyOSykKtaiWtnnMedZsE1deR8mzQ7+iXA4daMsJ7hDVeuo5ab GiQpcqu5TH1bqoapWIeL1vdqUV8sD4cnAMgqw68x/xX8TArXpRUUjXcstUj+4cJK1mFE th6UAduuVhyCYpSfvt6XjF1joYI2mgvfLyaeX/fvSnlCevekiOkaxwwr52Qcs1GSOLWy brOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=PKe1cTqq; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7-20020a170906a40700b0098874379199si4198176ejz.163.2023.07.22.14.26.07; Sat, 22 Jul 2023 14:26:40 -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; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=PKe1cTqq; 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 S229487AbjGVU07 (ORCPT + 99 others); Sat, 22 Jul 2023 16:26:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbjGVU06 (ORCPT ); Sat, 22 Jul 2023 16:26:58 -0400 Received: from smtp.smtpout.orange.fr (smtp-24.smtpout.orange.fr [80.12.242.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA778E58 for ; Sat, 22 Jul 2023 13:26:54 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id NJBjqtestHI6nNJBjqoPCR; Sat, 22 Jul 2023 22:26:53 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1690057613; bh=/NfZHk2r0r5O3/cXEnU1+UoN/5FO53TePxKwYDuLCpA=; h=From:To:Cc:Subject:Date; b=PKe1cTqqVlcZfB/XOHKLcypj0NEfxBin5w2lxtP0qdd4RRKgRGSxn/m4HCEafiOkV TUI6F7smKn+oyoepr6K6HVUqdlW/NEgK/AaehZR2ODes5kzkTSUhYlIoflc1pjEQu/ mhqu55prWGfKSkBv/caL88GXasi9SxAQPXloIq7RDUPgXv7dNIPzV8NpbtCjN/GJLW lDa+uVb+19stEJXPiOl0oV9PVu2ce6MDSG0dkKTGVAfMAHIFG/enr10b3QvpoCMAwC VyxXO398snf6NIaQhN+OLXknMzgVjSKnFmQQ1BWxV5QiMYMRB6heVSh/fxxL6vHJPz tlt5G/3UEFAQg== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 22 Jul 2023 22:26:53 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Pavel Machek , Lee Jones Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-leds@vger.kernel.org Subject: [PATCH] leds: ns2: Slightly simplify a memory allocation Date: Sat, 22 Jul 2023 22:26:49 +0200 Message-Id: <560b8f140c19a7da40f5e9540c3ef312969b0dc4.1690057595.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Use devm_kcalloc() instead of devm_kzalloc()+array_size(). Signed-off-by: Christophe JAILLET --- drivers/leds/leds-ns2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c index 1677d66d8b0e..f3010c472bbd 100644 --- a/drivers/leds/leds-ns2.c +++ b/drivers/leds/leds-ns2.c @@ -247,7 +247,7 @@ static int ns2_led_probe(struct platform_device *pdev) if (!count) return -ENODEV; - leds = devm_kzalloc(dev, array_size(sizeof(*leds), count), GFP_KERNEL); + leds = devm_kcalloc(dev, count, sizeof(*leds), GFP_KERNEL); if (!leds) return -ENOMEM; -- 2.34.1