[PATCH 1/3] checkpatch: Add devres_alloc() to allocation functions

[email protected]
Newsgroups org.kernel.vger.linux-pm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-usb
Message-ID <[email protected]>
From: bui duc phuc <[email protected]>

Add devres_alloc() and devres_alloc_node() to $allocFunctions so
checkpatch.pl can detect unnecessary out-of-memory messages
following a failed allocation.

Signed-off-by: bui duc phuc <[email protected]>
---

Link v1: 
https://lore.kernel.org/all/[email protected]/
Changes in v2:
 - Add devres_alloc_node() to $allocFunctions.
 - Update the commit message.

 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2b7a42bbdd94..e89cbc3f2604 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -644,7 +644,8 @@ our $allocFunctions = qr{(?x:
 		kmemdup(?:_nul)?) |
 	(?:\w+)?alloc_skb(?:_ip_align)? |
 				# dev_alloc_skb/netdev_alloc_skb, et al
-	dma_alloc_coherent
+	dma_alloc_coherent |
+	devres_alloc(?:_node)?
 )};
 
 our $signature_tags = qr{(?xi:
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.