From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65A95C433ED for ; Fri, 7 May 2021 01:04:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3AC5B61289 for ; Fri, 7 May 2021 01:04:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234069AbhEGBFB (ORCPT ); Thu, 6 May 2021 21:05:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:45276 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230499AbhEGBFB (ORCPT ); Thu, 6 May 2021 21:05:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E562B61041; Fri, 7 May 2021 01:04:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1620349442; bh=2vq0LSK54B9+W8z6g2r2aWsLvHO9Rwo+gsj/Zjkyuag=; h=Date:From:To:Subject:In-Reply-To:From; b=ePooyFJVqehxvxcMgNJbBjbEYl6HyJyFBLJE3J+oTtB6EMv7+da8DZEtXMfOoJ3R3 hDTM0DvhvfFAvdFZL8oUBla0uOEL/VIh4cIcU+HO7DsbDNz86VG0gzuvHKOAq6o3TI 2Y2g7WCLQ9Zq4jrtAsyIxWK8uNlFJs7bV47dGKCo= Date: Thu, 06 May 2021 18:04:01 -0700 From: Andrew Morton To: akpm@linux-foundation.org, christophe.jaillet@wanadoo.fr, joe@perches.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org Subject: [patch 38/91] checkpatch: improve ALLOC_ARRAY_ARGS test Message-ID: <20210507010401.kdZsz8cyt%akpm@linux-foundation.org> In-Reply-To: <20210506180126.03e1baee7ca52bedb6cc6003@linux-foundation.org> User-Agent: s-nail v14.8.16 Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org From: Christophe JAILLET Subject: checkpatch: improve ALLOC_ARRAY_ARGS test The devm_ variant of 'kcalloc()' and 'kmalloc_array()' are not tested Add the corresponding check. Link: https://lkml.kernel.org/r/205fc4847972fb6779abcc8818f39c14d1b45af1.1618595794.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Acked-by: Joe Perches Signed-off-by: Andrew Morton --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/scripts/checkpatch.pl~checkpatch-improve-alloc_array_args-test +++ a/scripts/checkpatch.pl @@ -7006,7 +7006,7 @@ sub process { } # check for alloc argument mismatch - if ($line =~ /\b(kcalloc|kmalloc_array)\s*\(\s*sizeof\b/) { + if ($line =~ /\b((?:devm_)?(?:kcalloc|kmalloc_array))\s*\(\s*sizeof\b/) { WARN("ALLOC_ARRAY_ARGS", "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr); } _