]> git.proxmox.com Git - mirror_qemu.git/commitdiff
checkpatch: suggest qemu_real_host_page_size instead of getpagesize() or sysconf...
authorWei Yang <richardw.yang@linux.intel.com>
Thu, 17 Oct 2019 00:46:33 +0000 (08:46 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 23 Oct 2019 15:50:27 +0000 (17:50 +0200)
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
CC: Richard Henderson <richard.henderson@linaro.org>
CC: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20191017004633.13229-1-richardw.yang@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scripts/checkpatch.pl

index aa9a354a0e7e9619b9dd2c8e263924288a8ca2ce..ab68a16fd228f7ccd30b1f91dae78cde54cf512a 100755 (executable)
@@ -2915,6 +2915,12 @@ sub process {
                if ($line =~ /\bbzero\(/) {
                        ERROR("use memset() instead of bzero()\n" . $herecurr);
                }
+               if ($line =~ /\bgetpagesize\(\)/) {
+                       ERROR("use qemu_real_host_page_size instead of getpagesize()\n" . $herecurr);
+               }
+               if ($line =~ /\bsysconf\(_SC_PAGESIZE\)/) {
+                       ERROR("use qemu_real_host_page_size instead of sysconf(_SC_PAGESIZE)\n" . $herecurr);
+               }
                my $non_exit_glib_asserts = qr{g_assert_cmpstr|
                                                g_assert_cmpint|
                                                g_assert_cmpuint|