diff mbox

checkpatch: add check for bzero

Message ID 1469091800-24164-1-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini July 21, 2016, 9:03 a.m. UTC
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 scripts/checkpatch.pl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Peter Xu July 21, 2016, 10:13 a.m. UTC | #1
On Thu, Jul 21, 2016 at 11:03:20AM +0200, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Thanks, Paolo.

Tested-By: Peter Xu <peterx@redhat.com>

> ---
>  scripts/checkpatch.pl | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index afa7f79..b7cb4ab 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2544,7 +2544,7 @@ sub process {
>  		}
>  	}
>  
> -# check for non-portable ffs() calls that have portable alternatives in QEMU
> +# check for non-portable libc calls that have portable alternatives in QEMU
>  		if ($line =~ /\bffs\(/) {
>  			ERROR("use ctz32() instead of ffs()\n" . $herecurr);
>  		}
> @@ -2554,6 +2554,9 @@ sub process {
>  		if ($line =~ /\bffsll\(/) {
>  			ERROR("use ctz64() instead of ffsll()\n" . $herecurr);
>  		}
> +		if ($line =~ /\bbzero\(/) {
> +			ERROR("use memset() instead of bzero()\n" . $herecurr);
> +		}
>  	}
>  
>  	# If we have no input at all, then there is nothing to report on
> -- 
> 2.7.4
> 
>
diff mbox

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index afa7f79..b7cb4ab 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2544,7 +2544,7 @@  sub process {
 		}
 	}
 
-# check for non-portable ffs() calls that have portable alternatives in QEMU
+# check for non-portable libc calls that have portable alternatives in QEMU
 		if ($line =~ /\bffs\(/) {
 			ERROR("use ctz32() instead of ffs()\n" . $herecurr);
 		}
@@ -2554,6 +2554,9 @@  sub process {
 		if ($line =~ /\bffsll\(/) {
 			ERROR("use ctz64() instead of ffsll()\n" . $herecurr);
 		}
+		if ($line =~ /\bbzero\(/) {
+			ERROR("use memset() instead of bzero()\n" . $herecurr);
+		}
 	}
 
 	# If we have no input at all, then there is nothing to report on