From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756894Ab0JaWeR (ORCPT ); Sun, 31 Oct 2010 18:34:17 -0400 Received: from mail.perches.com ([173.55.12.10]:3907 "EHLO mail.perches.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751145Ab0JaWeB (ORCPT ); Sun, 31 Oct 2010 18:34:01 -0400 From: Joe Perches To: linux-kernel@vger.kernel.org Cc: Andy Whitcroft Subject: [PATCH 4/4] scripts/checkpatch.pl: Add check for k.alloc GFP as first argument Date: Sun, 31 Oct 2010 15:33:56 -0700 Message-Id: X-Mailer: git-send-email 1.7.3.1.g432b3.dirty In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Joe Perches --- scripts/checkpatch.pl | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 90b54d4..114f667 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2789,6 +2789,11 @@ sub process { WARN("unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr); } +# check for k.alloc GFP in wrong location + if ($line =~ /\bk[czm]alloc\s*\(\s*\(?\s*GFP_/) { + ERROR("alloc has GFP_ as last argument\n" . $herecurr); + } + # check for gcc specific __FUNCTION__ if ($line =~ /__FUNCTION__/) { WARN("__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr); -- 1.7.3.1.g432b3.dirty