The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: phucduc.bui@gmail.com
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
	linux-kernel@vger.kernel.org
Cc: bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH] checkpatch: Add devres_alloc() to allocation functions
Date: Wed, 12 Aug 2026 09:43:04 +0700	[thread overview]
Message-ID: <20260812024304.9350-1-phucduc.bui@gmail.com> (raw)

From: bui duc phuc <phucduc.bui@gmail.com>

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

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2b7a42bbdd94..df042d31ff1f 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
 )};
 
 our $signature_tags = qr{(?xi:
-- 
2.43.0


             reply	other threads:[~2026-08-12  2:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12  2:43 phucduc.bui [this message]
2026-08-12  2:55 ` [PATCH] checkpatch: Add devres_alloc() to allocation functions Joe Perches
2026-08-12  3:51   ` Bui Duc Phuc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260812024304.9350-1-phucduc.bui@gmail.com \
    --to=phucduc.bui@gmail.com \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox