From nobody Sat Feb 7 23:34:11 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1656948371; cv=none; d=zohomail.com; s=zohoarc; b=ltyk6EMM+MTEcAcr6ZCNWfPYT5SY4woY8FPKARbtpz/cGyz1tV9TleYtohoKkqYPYULz0/xT+fGtPQeui9x/TY4OCNgrviA3YjZG16gRRuYovKplkIGz+ir52BRYZfjIaLmc20UqBwelkx1YCAsFof1rvPORLvhIryVFoMG//wY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656948371; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=W9YB6pphpSEN+DtosPIE336biqCnZmIn9fghJmwhRPU=; b=My5fGiNPBfgOgcJZZ3pSTrXpZA4YunIFdun09B7NORFhilisteoFUOrTN9V37bv4avk3XyFyAsRtOwi1fEuKL6FBBt6ENoG5Z2Pesyg/QA/OCzf/ZVaK2eeolAWUkejJMl2IfSp4mkEdRTCaCGINX8bmPu5IIdsoEkShgaX+bKQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656948371475924.5529182983464; Mon, 4 Jul 2022 08:26:11 -0700 (PDT) Received: from localhost ([::1]:40122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8Nxh-0000tA-LL for importer@patchew.org; Mon, 04 Jul 2022 11:26:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Nut-0004yN-Ig for qemu-devel@nongnu.org; Mon, 04 Jul 2022 11:23:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:44953) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Nuq-0002Lt-Uy for qemu-devel@nongnu.org; Mon, 04 Jul 2022 11:23:15 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-615-kW0ltrfpPXOBGdTi5m_50A-1; Mon, 04 Jul 2022 11:23:09 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C2362185A7A4; Mon, 4 Jul 2022 15:23:08 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6783FC28100; Mon, 4 Jul 2022 15:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656948192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W9YB6pphpSEN+DtosPIE336biqCnZmIn9fghJmwhRPU=; b=SBMwRhTnv4hk73WAne48w/YFpJL4HcP/vUgnLLXE3jZDFMWuKkDJ4jVK4eVM7YezCciPC8 d2JNn9woNba7/Oy1J3sWOq6ysA+XaA8M6l/2UVzta90Qj8Y8Ay4ZHTOBH6uVxvFn8Wmk6I Zku1fFsbuKZkR55+GCt06ikcuGlw10o= X-MC-Unique: kW0ltrfpPXOBGdTi5m_50A-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 1/7] tests: introduce tree-wide code style checking Date: Mon, 4 Jul 2022 16:22:57 +0100 Message-Id: <20220704152303.760983-2-berrange@redhat.com> In-Reply-To: <20220704152303.760983-1-berrange@redhat.com> References: <20220704152303.760983-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656948372004100001 Historically QEMU has used the 'scripts/checkpatch.pl' script to validate various style rules but there are a number of issues: - It requires the contributor to remember to run it as it is not wired into 'make check' - While it can be told to check whole files, in practice it is usually only used to check patch diffs, because the former would flag up pages of pre-existing violations that have never been fixed - It is said to be OK to ignore some things reported by the script, but don't record these exceptional cases anywere. Thus contributors looking at existing violations in tree are never sure whether they are intentional or historical unfixed technical debt. - There is no distinct reporting for each type of check performed and as a consequence there is also no way to mark particular files to be skipped for particular checks This commit aims to give us a better approach to checking many types of code style problems by introducing a flexible way to define whole tree style checks. The logic is essentially an import of the 'top/maint.mk' file from GNULIB, with the following changes applied - Logic unrelated to the GNULIB syntax-check functionality is removed. - sc_excl is redefined, so that whitespace is turned into an '|' condition. This allows filename exclusion lists to span multiple lines making it more readable. - VC_LIST is changed to directly invoke git instead of indirectly via the vc-list script, since QEMU does not need portaility across many source control systems. - .DEFAULT_GOAL is set to 'syntax-check' since this is being used in a self-contained manner and thus doesn't need to play nice with our makefile rules QEMU has This commit does the bare minimum introducing the basic infra: - tests/style-infra.mak - the cut down import of maint.mk - tests/style-excludes.mak - where the list of filename exclusions per test will be maintained (empty) - tests/style.mak - where the interesting tests live (empty) As a general rule new checks can be implemented by merely defining a regex matching the code pattern that should be blocked. For example, consider we want to stop people using the 'bool' type entirely. A rule starting with the prefix 'sc_' is defined in the style.mak file: sc_prohibit_bool: prohibit=3D'\' \ halt=3D'do not use the bool type' \ $(_sc_search_regexp) Where '$(_sc_search_regexp)' (acquired from style-infra.mak) contains all the magic to perform the tree-wide search for the offending code pattern, reporting '$(halt)' as the error message if violations are found. If certain files need to be skipped for certain tests this can be achieved by defining a variable with 'exclude_file_name_regexp--' followed by the name of the check exclude_file_name_regexp--sc_prohibit_bool =3D \ i-am-allowed-to-use-bool.c \ and-so-am-i.c Some checks can't be easily implemented by a simple per-line matching regex. Since the checks are just implemented in make/shell, custom rules can run essentially arbitrary logic. Note that the checks require the use of 'git' to detect the list of source files to search. Thus the check is skipped when not running from a git repository. Signed-off-by: Daniel P. Berrang=C3=A9 --- meson.build | 3 + tests/Makefile.include | 3 +- tests/meson.build | 19 +++ tests/style-excludes.mak | 4 + tests/style-infra.mak | 265 +++++++++++++++++++++++++++++++++++++++ tests/style.mak | 24 ++++ 6 files changed, 317 insertions(+), 1 deletion(-) create mode 100644 tests/style-excludes.mak create mode 100644 tests/style-infra.mak create mode 100644 tests/style.mak diff --git a/meson.build b/meson.build index 65a885ea69..420102353e 100644 --- a/meson.build +++ b/meson.build @@ -18,6 +18,9 @@ config_host =3D keyval.load(meson.current_build_dir() / '= config-host.mak') enable_modules =3D 'CONFIG_MODULES' in config_host enable_static =3D 'CONFIG_STATIC' in config_host =20 +make =3D find_program(config_host['MAKE']) +in_gitrepo =3D run_command('test', '-d', '.git', check: false).returncode(= ) =3D=3D 0 + # Allow both shared and static libraries unless --enable-static static_kwargs =3D enable_static ? {'static': true} : {} =20 diff --git a/tests/Makefile.include b/tests/Makefile.include index 3accb83b13..f7c1d2644e 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -3,12 +3,13 @@ .PHONY: check-help check-help: @echo "Regression testing targets:" - @echo " $(MAKE) check Run block, qapi-schema, unit, soft= float, qtest and decodetree tests" + @echo " $(MAKE) check Run block, qapi-schema, unit, styl= e, softfloat, qtest and decodetree tests" @echo " $(MAKE) bench Run speed tests" @echo @echo "Individual test suites:" @echo " $(MAKE) check-qtest-TARGET Run qtest tests for given target" @echo " $(MAKE) check-qtest Run qtest tests" + @echo " $(MAKE) check-style Run style checks" @echo " $(MAKE) check-unit Run qobject tests" @echo " $(MAKE) check-qapi-schema Run QAPI schema tests" @echo " $(MAKE) check-block Run block tests" diff --git a/tests/meson.build b/tests/meson.build index 8e318ec513..e26cadbc8a 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -89,6 +89,25 @@ if get_option('tcg').allowed() endif endif =20 +if in_gitrepo + rc =3D run_command( + 'sed', '-n', + 's/^sc_\\([a-zA-Z0-9_-]*\\):.*/\\1/p', + meson.current_source_dir() / 'style.mak', + check: true, + ) + + sc_tests =3D rc.stdout().strip().split() + + foreach check: sc_tests + test(check, + make, + args: [ '-f', files('style.mak'), 'sc_' + check ], + workdir: meson.project_source_root(), + suite: 'style') + endforeach +endif + subdir('unit') subdir('qapi-schema') subdir('qtest') diff --git a/tests/style-excludes.mak b/tests/style-excludes.mak new file mode 100644 index 0000000000..32c0e9c328 --- /dev/null +++ b/tests/style-excludes.mak @@ -0,0 +1,4 @@ +# -*- makefile -*- +# +# Filenames that should be excluded from specific +# style checks performed by style.mak diff --git a/tests/style-infra.mak b/tests/style-infra.mak new file mode 100644 index 0000000000..99229f0c3f --- /dev/null +++ b/tests/style-infra.mak @@ -0,0 +1,265 @@ +# -*- makefile -*- +# +# Rules for simple code style checks applying across the +# whole tree. Partially derived from GNULIB's 'maint.mk' +# +# Copyright (C) 2008-2019 Red Hat, Inc. +# Copyright (C) 2003-2019 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# . + +ME :=3D tests/style.mak + +srcdir =3D . + +AWK ?=3D awk +GREP ?=3D grep +SED ?=3D sed + +# Helper variables. +_empty =3D +_sp =3D $(_empty) $(_empty) + +VC_LIST =3D (cd $(srcdir) && git ls-tree -r 'HEAD:' | \ + sed -n "s|^100[^ ]*.||p" ) + +# You can override this variable in cfg.mk if your gnulib submodule lives +# in a different location. +gnulib_dir ?=3D $(shell if test -f $(srcdir)/gnulib/gnulib-tool; then \ + echo $(srcdir)/gnulib; \ + else \ + echo ${GNULIB_SRCDIR}; \ + fi) + +# You can override this variable in cfg.mk to set your own regexp +# matching files to ignore. +VC_LIST_ALWAYS_EXCLUDE_REGEX ?=3D ^$$ + +# This is to preprocess robustly the output of $(VC_LIST), so that even +# when $(srcdir) is a pathological name like "....", the leading sed comma= nd +# removes only the intended prefix. +_dot_escaped_srcdir =3D $(subst .,\.,$(srcdir)) + +# Post-process $(VC_LIST) output, prepending $(srcdir)/, but only +# when $(srcdir) is not ".". +ifeq ($(srcdir),.) + _prepend_srcdir_prefix =3D +else + _prepend_srcdir_prefix =3D | $(SED) 's|^|$(srcdir)/|' +endif + +# In order to be able to consistently filter "."-relative names, +# (i.e., with no $(srcdir) prefix), this definition is careful to +# remove any $(srcdir) prefix, and to restore what it removes. +_sc_excl =3D \ + $(or $(subst $(_sp),|,$(exclude_file_name_regexp--$@)),^$$) + +VC_LIST_EXCEPT =3D \ + $(VC_LIST) | $(SED) 's|^$(_dot_escaped_srcdir)/||' \ + | if test -f $(srcdir)/.x-$@; then $(GREP) -vEf $(srcdir)/.x-$@; \ + else $(GREP) -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \ + | $(GREP) -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \ + $(_prepend_srcdir_prefix) + + +# Prevent programs like 'sort' from considering distinct strings to be equ= al. +# Doing it here saves us from having to set LC_ALL elsewhere in this file. +export LC_ALL =3D C + +# Collect the names of rules starting with 'sc_'. +syntax-check-rules :=3D $(sort $(shell env LC_ALL=3DC $(SED) -n \ + 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(srcdir)/$(ME))) +.PHONY: $(syntax-check-rules) + +ifeq ($(shell $(VC_LIST) >/dev/null 2>&1; echo $$?),0) + local-checks-available +=3D $(syntax-check-rules) +else + local-checks-available +=3D no-vc-detected +no-vc-detected: + @echo "No version control files detected; skipping syntax check" +endif +.PHONY: $(local-checks-available) + +# Arrange to print the name of each syntax-checking rule just before runni= ng it. +$(syntax-check-rules): %: %.m +sc_m_rules_ =3D $(patsubst %, %.m, $(syntax-check-rules)) +.PHONY: $(sc_m_rules_) +$(sc_m_rules_): + @echo $(patsubst sc_%.m, %, $@) + @date +%s.%N > .sc-start-$(basename $@) + +# Compute and print the elapsed time for each syntax-check rule. +sc_z_rules_ =3D $(patsubst %, %.z, $(syntax-check-rules)) +.PHONY: $(sc_z_rules_) +$(sc_z_rules_): %.z: % + @end=3D$$(date +%s.%N); \ + start=3D$$(cat .sc-start-$*); \ + rm -f .sc-start-$*; \ + $(AWK) -v s=3D$$start -v e=3D$$end \ + 'END {printf "%.2f $(patsubst sc_%,%,$*)\n", e - s}' < /dev/null + +# The patsubst here is to replace each sc_% rule with its sc_%.z wrapper +# that computes and prints elapsed time. +local-check :=3D \ + $(patsubst sc_%, sc_%.z, \ + $(filter-out $(local-checks-to-skip), $(local-checks-available))) + +syntax-check: $(local-check) + +.DEFAULT_GOAL :=3D syntax-check + +# _sc_search_regexp +# +# This macro searches for a given construct in the selected files and +# then takes some action. +# +# Parameters (shell variables): +# +# prohibit | require +# +# Regular expression (ERE) denoting either a forbidden construct +# or a required construct. Those arguments are exclusive. +# +# exclude +# +# Regular expression (ERE) denoting lines to ignore that matched +# a prohibit construct. For example, this can be used to exclude +# comments that mention why the nearby code uses an alternative +# construct instead of the simpler prohibited construct. +# +# in_vc_files | in_files +# +# grep-E-style regexp selecting the files to check. For in_vc_files, +# the regexp is used to select matching files from the list of all +# version-controlled files; for in_files, it's from the names printed +# by "find $(srcdir)". When neither is specified, use all files that +# are under version control. +# +# containing | non_containing +# +# Select the files (non) containing strings matching this regexp. +# If both arguments are specified then CONTAINING takes +# precedence. +# +# with_grep_options +# +# Extra options for grep. +# +# ignore_case +# +# Ignore case. +# +# halt +# +# Message to display before to halting execution. +# +# Finally, you may exempt files based on an ERE matching file names. +# For example, to exempt from the sc_space_tab check all files with the +# .diff suffix, set this Make variable: +# +# exclude_file_name_regexp--sc_space_tab =3D \.diff$ +# +# Note that while this functionality is mostly inherited via VC_LIST_EXCEP= T, +# when filtering by name via in_files, we explicitly filter out matching +# names here as well. + +# Initialize each, so that envvar settings cannot interfere. +export require =3D +export prohibit =3D +export exclude =3D +export in_vc_files =3D +export in_files =3D +export containing =3D +export non_containing =3D +export halt =3D +export with_grep_options =3D + +# By default, _sc_search_regexp does not ignore case. +export ignore_case =3D +_ignore_case =3D $$(test -n "$$ignore_case" && printf %s -i || :) + +define _sc_say_and_exit + dummy=3D; : so we do not need a semicolon before each use; \ + { printf '%s\n' "$(ME): $$msg" 1>&2; exit 1; }; +endef + +define _sc_search_regexp + dummy=3D; : so we do not need a semicolon before each use; \ + \ + : Check arguments; \ + test -n "$$prohibit" && test -n "$$require" \ + && { msg=3D'Cannot specify both prohibit and require' \ + $(_sc_say_and_exit) } || :; \ + test -z "$$prohibit" && test -z "$$require" \ + && { msg=3D'Should specify either prohibit or require' \ + $(_sc_say_and_exit) } || :; \ + test -z "$$prohibit" && test -n "$$exclude" \ + && { msg=3D'Use of exclude requires a prohibit pattern' \ + $(_sc_say_and_exit) } || :; \ + test -n "$$in_vc_files" && test -n "$$in_files" \ + && { msg=3D'Cannot specify both in_vc_files and in_files' \ + $(_sc_say_and_exit) } || :; \ + test "x$$halt" !=3D x \ + || { msg=3D'halt not defined' $(_sc_say_and_exit) }; \ + \ + : Filter by file name; \ + if test -n "$$in_files"; then \ + files=3D$$(find $(srcdir) | $(GREP) -E "$$in_files" \ + | $(GREP) -Ev '$(_sc_excl)'); \ + else \ + files=3D$$($(VC_LIST_EXCEPT)); \ + if test -n "$$in_vc_files"; then \ + files=3D$$(echo "$$files" | $(GREP) -E "$$in_vc_files"); \ + fi; \ + fi; \ + \ + : Filter by content; \ + test -n "$$files" \ + && test -n "$$containing" \ + && { files=3D$$(echo "$$files" | xargs $(GREP) -l "$$containing"); } \ + || :; \ + test -n "$$files" \ + && test -n "$$non_containing" \ + && { files=3D$$(echo "$$files" | xargs $(GREP) -vl "$$non_containing"= ); } \ + || :; \ + \ + : Check for the construct; \ + if test -n "$$files"; then \ + if test -n "$$prohibit"; then \ + echo "$$files" \ + | xargs $(GREP) $$with_grep_options $(_ignore_case) -nE \ + "$$prohibit" /dev/null \ + | $(GREP) -vE "$${exclude:-^$$}" \ + && { msg=3D"$$halt" $(_sc_say_and_exit) } \ + || :; \ + else \ + echo "$$files" \ + | xargs \ + $(GREP) $$with_grep_options $(_ignore_case) -LE "$$require" \ + | $(GREP) . \ + && { msg=3D"$$halt" $(_sc_say_and_exit) } \ + || :; \ + fi \ + else :; \ + fi || :; +endef + +# Perl block to convert a match to FILE_NAME:LINENO:TEST +perl_filename_lineno_text_ =3D \ + -e ' {' \ + -e ' $$n =3D ($$` =3D~ tr/\n/\n/ + 1);' \ + -e ' ($$v =3D $$&) =3D~ s/\n/\\n/g;' \ + -e ' print "$$ARGV:$$n:$$v\n";' \ + -e ' }' diff --git a/tests/style.mak b/tests/style.mak new file mode 100644 index 0000000000..32c7e706ba --- /dev/null +++ b/tests/style.mak @@ -0,0 +1,24 @@ +# -*- makefile -*- +# +# Rules for simple code style checks applying across the +# whole tree. Partially derived from GNULIB's 'maint.mk' +# +# Copyright (C) 2008-2019 Red Hat, Inc. +# Copyright (C) 2003-2019 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# . + +include tests/style-infra.mak +include tests/style-excludes.mak --=20 2.36.1 From nobody Sat Feb 7 23:34:11 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1656948309; cv=none; d=zohomail.com; s=zohoarc; b=RFs6bduhCn2y5wDL3ZDr+tVpaz4KGe71MTGKHR1phJ3aWvQYQcEHyBor96UNt676Q5/lC2qMImIy/VPecVG3cnpBRotkoJgoczROa+R3RH1S1PO7q/0C8Fzu1qWA7lcpiaB4/ygq39Fz8otmwRc1lpFejsFu9EpyBcgsD/jYsjk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656948309; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UrL2nj+uX/hvqKpBrStGoWhbrCZXAZE6aOGjVbKi+m8=; b=nE9euGL/U/tPNuhghLlkbBoHBsdzsQpEFEHA+VRtCvC2hxzyJ0WKrximhUvhrn9Crwz0ZvhoWN8FaUoC15fpg+7Kv83QoLIXI+nccZ5l4kG/UrKh4csd+GLEhON+4JLaZSmCiHhVSkXt4fv0EzzDQiqlyVTIb2vy4tE/4sI28qU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656948309948859.8830988128138; Mon, 4 Jul 2022 08:25:09 -0700 (PDT) Received: from localhost ([::1]:38186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8Nwi-0007wr-MA for importer@patchew.org; Mon, 04 Jul 2022 11:25:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Nuv-00051h-08 for qemu-devel@nongnu.org; Mon, 04 Jul 2022 11:23:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48308) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Nut-0002MK-Db for qemu-devel@nongnu.org; Mon, 04 Jul 2022 11:23:16 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-44-qyjvA9pEPYe8kGgMPK5fvQ-1; Mon, 04 Jul 2022 11:23:11 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D48F93C0CD41; Mon, 4 Jul 2022 15:23:10 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id 205E4C28100; Mon, 4 Jul 2022 15:23:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656948194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UrL2nj+uX/hvqKpBrStGoWhbrCZXAZE6aOGjVbKi+m8=; b=gNFVAMppm9M5vMzK+UsWHnl2Ma3GiWb42rd5qfPBkwbe9H5s/9I8pD0fVapdTjzQSqP/07 fJCGgM7bv1MaVXm4vn6I3r165oOeegNqM5Z1MVBYT9IM0Lt0gue6ct9RbBgRmCDut+8Pwl o8oTn5wDZiuQFxe46Cc8SoO8PDyK1lA= X-MC-Unique: qyjvA9pEPYe8kGgMPK5fvQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 2/7] misc: fix mixups of bool constants with int variables Date: Mon, 4 Jul 2022 16:22:58 +0100 Message-Id: <20220704152303.760983-3-berrange@redhat.com> In-Reply-To: <20220704152303.760983-1-berrange@redhat.com> References: <20220704152303.760983-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656948311634100003 Signed-off-by: Daniel P. Berrang=C3=A9 --- block/vhdx-log.c | 2 +- hw/xtensa/sim.c | 4 ++-- nbd/client.c | 4 ++-- target/i386/cpu-dump.c | 3 ++- ui/spice-display.c | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/block/vhdx-log.c b/block/vhdx-log.c index ff0d4e0da0..8f34755a6f 100644 --- a/block/vhdx-log.c +++ b/block/vhdx-log.c @@ -215,7 +215,7 @@ exit: static bool vhdx_log_hdr_is_valid(VHDXLogEntries *log, VHDXLogEntryHeader = *hdr, BDRVVHDXState *s) { - int valid =3D false; + bool valid =3D false; =20 if (hdr->signature !=3D VHDX_LOG_SIGNATURE) { goto exit; diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c index 946c71cb5b..70fce7fb85 100644 --- a/hw/xtensa/sim.c +++ b/hw/xtensa/sim.c @@ -97,9 +97,9 @@ void xtensa_sim_load_kernel(XtensaCPU *cpu, MachineState = *machine) { const char *kernel_filename =3D machine->kernel_filename; #if TARGET_BIG_ENDIAN - int big_endian =3D true; + int big_endian =3D 1; #else - int big_endian =3D false; + int big_endian =3D 0; #endif =20 if (kernel_filename) { diff --git a/nbd/client.c b/nbd/client.c index 30d5383cb1..fee3959d24 100644 --- a/nbd/client.c +++ b/nbd/client.c @@ -832,8 +832,8 @@ static int nbd_list_meta_contexts(QIOChannel *ioc, Error **errp) { int ret; - int seen_any =3D false; - int seen_qemu =3D false; + bool seen_any =3D false; + bool seen_qemu =3D false; =20 if (nbd_send_meta_query(ioc, NBD_OPT_LIST_META_CONTEXT, info->name, NULL, errp) < 0) { diff --git a/target/i386/cpu-dump.c b/target/i386/cpu-dump.c index 08ac957e99..43521c74c8 100644 --- a/target/i386/cpu-dump.c +++ b/target/i386/cpu-dump.c @@ -275,7 +275,8 @@ static void dump_apic_icr(APICCommonState *s, CPUX86Sta= te *env) static void dump_apic_interrupt(const char *name, uint32_t *ireg_tab, uint32_t *tmr_tab) { - int i, empty =3D true; + int i; + bool empty =3D true; =20 qemu_printf("%s\t ", name); for (i =3D 0; i < 256; i++) { diff --git a/ui/spice-display.c b/ui/spice-display.c index 494168e7fe..5d3b64413f 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -541,14 +541,14 @@ static int interface_get_command(QXLInstance *sin, QX= LCommandExt *ext) { SimpleSpiceDisplay *ssd =3D container_of(sin, SimpleSpiceDisplay, qxl); SimpleSpiceUpdate *update; - int ret =3D false; + int ret =3D 0; =20 qemu_mutex_lock(&ssd->lock); update =3D QTAILQ_FIRST(&ssd->updates); if (update !=3D NULL) { QTAILQ_REMOVE(&ssd->updates, update, next); *ext =3D update->ext; - ret =3D true; + ret =3D 1; } qemu_mutex_unlock(&ssd->lock); =20 --=20 2.36.1 From nobody Sat Feb 7 23:34:11 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1656948307; cv=none; d=zohomail.com; s=zohoarc; b=Q4irh1GYfvLdWRUqB5WT0s0uIdSHgyINU59DP/qGTD1yqXmMvNLJTgHDADO+CE8j106fQG0YGG1xVb4GUEHxi47vrN2puM5iClOU/7MolKbjsGckDZ7JGjSv66zmh0Kg8PxQvcXjKlRxANJE7kODkIopRn2dUxMKWNlhvY9dJ6U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656948307; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=a5v2G6lem/ZEC576JClSBjYZBfiuor+hY2xGADyGt3w=; b=n4/JsYoF2XuplI2PKAZ93N/DbCY1DcS4m2ONn3mTplroemrtgLigczVsjIkKrzLcjNhJ0jz8PgDup+plZVnWQm/U/Vs4mEVOx0/nkxS3xjFJsQoMZ2fEmSlAARq5rZW+sjBLZZ3R4eUE70ikokkBHS3M6tiDZ5li0cWis+/w8SQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656948307634748.0931532535888; Mon, 4 Jul 2022 08:25:07 -0700 (PDT) Received: from localhost ([::1]:38112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8Nwe-0007sP-IH for importer@patchew.org; Mon, 04 Jul 2022 11:25:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Nuu-000515-PB for qemu-devel@nongnu.org; Mon, 04 Jul 2022 11:23:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Nut-0002MH-BX for qemu-devel@nongnu.org; Mon, 04 Jul 2022 11:23:16 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-314-Tmb0p90DMkyGJY5AhEj8nA-1; Mon, 04 Jul 2022 11:23:13 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EA36E101A586; Mon, 4 Jul 2022 15:23:12 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id 36615C28100; Mon, 4 Jul 2022 15:23:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656948194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a5v2G6lem/ZEC576JClSBjYZBfiuor+hY2xGADyGt3w=; b=ChTAHQyGAPYXW4KFeWoT4ALXwSJhV0eUKp4JZLqPdYgrG7ACsCSAS9UyFPzsaRpFKxg749 CGacBH17r1hpehNQkjjVwulMqjbAEWVtm/aLdisOhH/rYSpD+sINp7+toT3cdw1i549B5t 2+EDCummmcaVQtIn4Rqr+2BNNOHrgbo= X-MC-Unique: Tmb0p90DMkyGJY5AhEj8nA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 3/7] tests/style: check for mixups of bool constants with int variables Date: Mon, 4 Jul 2022 16:22:59 +0100 Message-Id: <20220704152303.760983-4-berrange@redhat.com> In-Reply-To: <20220704152303.760983-1-berrange@redhat.com> References: <20220704152303.760983-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656948309715100001 The 'true' and 'false' constants should only ever be used with the 'bool' type, never 'int'. Signed-off-by: Daniel P. Berrang=C3=A9 --- tests/style.mak | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/style.mak b/tests/style.mak index 32c7e706ba..ae658395c9 100644 --- a/tests/style.mak +++ b/tests/style.mak @@ -22,3 +22,9 @@ =20 include tests/style-infra.mak include tests/style-excludes.mak + +# Use 'bool', not 'int', when assigning true or false +sc_int_assign_bool: + @prohibit=3D'\.*=3D *(true|false)\b' \ + halt=3D'use bool type for boolean values' \ + $(_sc_search_regexp) --=20 2.36.1 From nobody Sat Feb 7 23:34:11 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1656948455; cv=none; d=zohomail.com; s=zohoarc; b=TUFwPCkbGkH5zZebM6Gon9D8Mmq+ZsSi7bmU+hkpUc/8xBlyOmKAR2gvTeCIvxGWf98vedH8Pisx/PsBGmW4hrLntuKrlHaa/pkp3gzL/w22Rz3TtLtxXqe4GXi0JoEa20tAxwe6H/enbWyL8sZ3Y3IAhQsMl6Nz75z/87z5aSE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656948455; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xuGeFr8SXBbNcc1P9/9Yvi8RCDEp+5LrTRd8zpAL4ks=; b=D+r6Z23HsoEifcFRJpBnF5rOsxNjMdJMIidBHPiReCV965+eznFPVZf5G1dVoP656pCqv0ZggK5+Iu90FJO5VQdL1T6n6fk6tT3cVJHMl8O6sZcf8eqWn7JmOX5z0gQFSrfSG895GCuihVfNHXZLKJ5lQ02lvbS2twrbq6auoew= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165694845582012.305582560179573; Mon, 4 Jul 2022 08:27:35 -0700 (PDT) Received: from localhost ([::1]:46482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8Nz4-0005UY-LX for importer@patchew.org; Mon, 04 Jul 2022 11:27:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Nv0-0005Jq-7D for qemu-devel@nongnu.org; Mon, 04 Jul 2022 11:23:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:38458) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Nux-0002Mx-3e for qemu-devel@nongnu.org; Mon, 04 Jul 2022 11:23:21 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-263-l8u3rN3_MGabp3C0YMO-Lg-1; Mon, 04 Jul 2022 11:23:15 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 050621C06EE7; Mon, 4 Jul 2022 15:23:15 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5093DC28100; Mon, 4 Jul 2022 15:23:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656948198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xuGeFr8SXBbNcc1P9/9Yvi8RCDEp+5LrTRd8zpAL4ks=; b=SJmC3oYQsGT4hso5IKOYVTmce0Rlo8lf3x3wkLHfMs2K6zCTklrdYTo+K1/YTl8/tMPL5H AyYUEIX/aPuuKX+Ie849ZDhFDmppT+qCMK4PIxncmWEc/1EjZt68XwZJmNOnTcQpfY/tQW 7YVtQxdXy5jWKLy3FyTG0W3nlpHPhz0= X-MC-Unique: l8u3rN3_MGabp3C0YMO-Lg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 4/7] misc: fix commonly doubled up words Date: Mon, 4 Jul 2022 16:23:00 +0100 Message-Id: <20220704152303.760983-5-berrange@redhat.com> In-Reply-To: <20220704152303.760983-1-berrange@redhat.com> References: <20220704152303.760983-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656948456939100003 Signed-off-by: Daniel P. Berrang=C3=A9 --- block/linux-aio.c | 2 +- block/qcow2-bitmap.c | 8 ++++---- contrib/plugins/cache.c | 2 +- disas/libvixl/vixl/invalset.h | 2 +- docs/devel/qom.rst | 4 ++-- docs/interop/live-block-operations.rst | 4 ++-- docs/system/arm/cpu-features.rst | 2 +- docs/system/devices/cxl.rst | 2 +- docs/system/s390x/bootdevices.rst | 2 +- docs/system/tls.rst | 2 +- docs/tools/qemu-pr-helper.rst | 2 +- hw/core/clock.c | 2 +- hw/intc/arm_gicv3_redist.c | 2 +- hw/misc/iotkit-secctl.c | 2 +- hw/misc/iotkit-sysctl.c | 4 ++-- hw/s390x/s390-ccw.c | 2 +- hw/usb/u2f.h | 2 +- include/hw/qdev-core.h | 2 +- include/user/safe-syscall.h | 2 +- linux-user/i386/cpu_loop.c | 2 +- pc-bios/s390-ccw/virtio-scsi.c | 2 +- python/Makefile | 2 +- python/qemu/utils/__init__.py | 2 +- target/arm/translate.c | 2 +- target/i386/cpu.c | 2 +- tcg/i386/tcg-target.c.inc | 2 +- tests/qtest/microbit-test.c | 4 ++-- tools/virtiofsd/fuse_virtio.c | 2 +- 28 files changed, 35 insertions(+), 35 deletions(-) diff --git a/block/linux-aio.c b/block/linux-aio.c index 9c2393a2f7..d2cfb7f523 100644 --- a/block/linux-aio.c +++ b/block/linux-aio.c @@ -461,7 +461,7 @@ LinuxAioState *laio_init(Error **errp) s =3D g_malloc0(sizeof(*s)); rc =3D event_notifier_init(&s->e, false); if (rc < 0) { - error_setg_errno(errp, -rc, "failed to to initialize event notifie= r"); + error_setg_errno(errp, -rc, "failed to initialize event notifier"); goto out_free_state; } =20 diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c index 8fb4731551..5529368df4 100644 --- a/block/qcow2-bitmap.c +++ b/block/qcow2-bitmap.c @@ -787,10 +787,10 @@ static int bitmap_list_store(BlockDriverState *bs, Qc= ow2BitmapList *bm_list, } } =20 - /* Actually, even in in-place case ignoring QCOW2_OL_BITMAP_DIRECTORY = is not - * necessary, because we drop QCOW2_AUTOCLEAR_BITMAPS when updating bi= tmap - * directory in-place (actually, turn-off the extension), which is che= cked - * in qcow2_check_metadata_overlap() */ + /* Actually, even in the in-place case ignoring QCOW2_OL_BITMAP_DIRECT= ORY + * is not necessary, because we drop QCOW2_AUTOCLEAR_BITMAPS when upda= ting + * bitmap directory in-place (actually, turn-off the extension), which= is + * checked in qcow2_check_metadata_overlap() */ ret =3D qcow2_pre_write_overlap_check( bs, in_place ? QCOW2_OL_BITMAP_DIRECTORY : 0, dir_offset, dir_= size, false); diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index b9226e7c40..ac1510aaa1 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -38,7 +38,7 @@ enum EvictionPolicy policy; * put in any of the blocks inside the set. The number of block per set is * called the associativity (assoc). * - * Each block contains the the stored tag and a valid bit. Since this is n= ot + * Each block contains the stored tag and a valid bit. Since this is not * a functional simulator, the data itself is not stored. We only identify * whether a block is in the cache or not by searching for its tag. * diff --git a/disas/libvixl/vixl/invalset.h b/disas/libvixl/vixl/invalset.h index 2e0871f8c3..f5d6c43d81 100644 --- a/disas/libvixl/vixl/invalset.h +++ b/disas/libvixl/vixl/invalset.h @@ -102,7 +102,7 @@ template class InvalSet { size_t size() const; =20 // Returns true if no elements are stored in the set. - // Note that this does not mean the the backing storage is empty: it can= still + // Note that this does not mean the backing storage is empty: it can sti= ll // contain invalid elements. bool empty() const; =20 diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst index e5fe3597cd..62c39c9c88 100644 --- a/docs/devel/qom.rst +++ b/docs/devel/qom.rst @@ -372,8 +372,8 @@ This accepts an array of interface type names. { TYPE_USER_CREATABLE }, { NULL }) =20 -If the type is not intended to be instantiated, then then -the OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead: +If the type is not intended to be instantiated, then the +OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead: =20 .. code-block:: c :caption: Defining a simple abstract type diff --git a/docs/interop/live-block-operations.rst b/docs/interop/live-blo= ck-operations.rst index 39e62c9915..135784ab33 100644 --- a/docs/interop/live-block-operations.rst +++ b/docs/interop/live-block-operations.rst @@ -53,7 +53,7 @@ files in a disk image backing chain: =20 (1) Directional: 'base' and 'top'. Given the simple disk image chain above, image [A] can be referred to as 'base', and image [B] as - 'top'. (This terminology can be seen in in QAPI schema file, + 'top'. (This terminology can be seen in the QAPI schema file, block-core.json.) =20 (2) Relational: 'backing file' and 'overlay'. Again, taking the same @@ -825,7 +825,7 @@ entire disk image chain, to a target, using ``blockdev-= mirror`` would be: job ready to be completed =20 (5) Gracefully complete the 'mirror' block device job, and notice the - the event ``BLOCK_JOB_COMPLETED`` + event ``BLOCK_JOB_COMPLETED`` =20 (6) Shutdown the guest by issuing the QMP ``quit`` command so that caches are flushed diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-feature= s.rst index 3fd76fa0b4..c2c01ec7d2 100644 --- a/docs/system/arm/cpu-features.rst +++ b/docs/system/arm/cpu-features.rst @@ -284,7 +284,7 @@ SVE CPU Property Parsing Semantics CPU Property Dependencies and Constraints"). =20 4) If one or more vector lengths have been explicitly enabled and at - at least one of the dependency lengths of the maximum enabled length + least one of the dependency lengths of the maximum enabled length has been explicitly disabled, then an error is generated (see constraint (2) of "SVE CPU Property Dependencies and Constraints"). =20 diff --git a/docs/system/devices/cxl.rst b/docs/system/devices/cxl.rst index a57e4c4e5c..36031325cc 100644 --- a/docs/system/devices/cxl.rst +++ b/docs/system/devices/cxl.rst @@ -15,7 +15,7 @@ with CXL Host Bridges, which have CXL Root Ports which ma= y be directly attached to CXL or PCI End Points. Alternatively there may be CXL Switches with CXL and PCI Endpoints attached below them. In many cases additional control and capabilities are exposed via PCI Express interfaces. -This sharing of interfaces and hence emulation code is is reflected +This sharing of interfaces and hence emulation code is reflected in how the devices are emulated in QEMU. In most cases the various CXL elements are built upon an equivalent PCIe devices. =20 diff --git a/docs/system/s390x/bootdevices.rst b/docs/system/s390x/bootdevi= ces.rst index 9e591cb9dc..b5950133e8 100644 --- a/docs/system/s390x/bootdevices.rst +++ b/docs/system/s390x/bootdevices.rst @@ -65,7 +65,7 @@ you can specify it via the ``-global s390-ipl.netboot_fw= =3Dfilename`` command line option. =20 The ``bootindex`` property is especially important for booting via the net= work. -If you don't specify the the ``bootindex`` property here, the network boot= loader +If you don't specify the ``bootindex`` property here, the network bootload= er firmware code won't get loaded into the guest memory so that the network b= oot will fail. For a successful network boot, try something like this:: =20 diff --git a/docs/system/tls.rst b/docs/system/tls.rst index 1a04674362..e284c82801 100644 --- a/docs/system/tls.rst +++ b/docs/system/tls.rst @@ -182,7 +182,7 @@ certificates. --template client-hostNNN.info \ --outfile client-hostNNN-cert.pem =20 -The subject alt name extension data is not required for clients, so the +The subject alt name extension data is not required for clients, so the ``dns_name`` and ``ip_address`` fields are not included. The ``tls_www_client`` keyword is the key purpose extension to indicate this certificate is intended for usage in a web client. Although QEMU network diff --git a/docs/tools/qemu-pr-helper.rst b/docs/tools/qemu-pr-helper.rst index eaebe40da0..bbd8b6c3ce 100644 --- a/docs/tools/qemu-pr-helper.rst +++ b/docs/tools/qemu-pr-helper.rst @@ -22,7 +22,7 @@ storage fabric. QEMU's SCSI passthrough devices ``scsi-bl= ock`` and ``scsi-generic`` support passing guest persistent reservation requests to a privileged external helper program. :program:`qemu-pr-helper` is that external helper; it creates a socket which QEMU can -connect to to communicate with it. +connect to communicate with it. =20 If you want to run VMs in a setup like this, this helper should be started as a system service, and you should read the QEMU manual diff --git a/hw/core/clock.c b/hw/core/clock.c index 916875e07a..d82e44cd1a 100644 --- a/hw/core/clock.c +++ b/hw/core/clock.c @@ -68,7 +68,7 @@ static uint64_t clock_get_child_period(Clock *clk) { /* * Return the period to be used for child clocks, which is the parent - * clock period adjusted for for multiplier and divider effects. + * clock period adjusted for multiplier and divider effects. */ return muldiv64(clk->period, clk->multiplier, clk->divider); } diff --git a/hw/intc/arm_gicv3_redist.c b/hw/intc/arm_gicv3_redist.c index f1ecb2502b..c92ceecc16 100644 --- a/hw/intc/arm_gicv3_redist.c +++ b/hw/intc/arm_gicv3_redist.c @@ -492,7 +492,7 @@ static MemTxResult gicr_writel(GICv3CPUState *cs, hwadd= r offset, return MEMTX_OK; case GICR_WAKER: /* Only the ProcessorSleep bit is writable. When the guest sets - * it it requests that we transition the channel between the + * it, it requests that we transition the channel between the * redistributor and the cpu interface to quiescent, and that * we set the ChildrenAsleep bit once the inteface has reached the * quiescent state. diff --git a/hw/misc/iotkit-secctl.c b/hw/misc/iotkit-secctl.c index 7b41cfa8fc..b5a9e30a2c 100644 --- a/hw/misc/iotkit-secctl.c +++ b/hw/misc/iotkit-secctl.c @@ -114,7 +114,7 @@ static const uint8_t iotkit_secctl_ns_sse300_idregs[] = =3D { * AHB expansion, APB expansion) are all set up so that they are * in 16-aligned blocks so offsets 0xN0, 0xN4, 0xN8, 0xNC are PPCs * 0, 1, 2, 3 of that type, so we can convert a register address offset - * into an an index into a PPC array easily. + * into an index into a PPC array easily. */ static inline int offset_to_ppc_idx(uint32_t offset) { diff --git a/hw/misc/iotkit-sysctl.c b/hw/misc/iotkit-sysctl.c index 9ee8fe8495..7147e2f84e 100644 --- a/hw/misc/iotkit-sysctl.c +++ b/hw/misc/iotkit-sysctl.c @@ -237,7 +237,7 @@ static uint64_t iotkit_sysctl_read(void *opaque, hwaddr= offset, r =3D s->ewctrl; break; case ARMSSE_SSE300: - /* In SSE300 this offset is is NMI_ENABLE */ + /* In SSE300 this offset is NMI_ENABLE */ r =3D s->nmi_enable; break; default: @@ -555,7 +555,7 @@ static void iotkit_sysctl_write(void *opaque, hwaddr of= fset, s->ewctrl =3D value; break; case ARMSSE_SSE300: - /* In SSE300 this offset is is NMI_ENABLE */ + /* In SSE300 this offset is NMI_ENABLE */ qemu_log_mask(LOG_UNIMP, "IoTKit SysCtl NMI_ENABLE unimplement= ed\n"); s->nmi_enable =3D value; break; diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c index 2fc8bb9c23..e2d86d96e7 100644 --- a/hw/s390x/s390-ccw.c +++ b/hw/s390x/s390-ccw.c @@ -57,7 +57,7 @@ IOInstEnding s390_ccw_store(SubchDev *sch) =20 /* * This code is called for both virtual and passthrough devices, - * but only applies to to the latter. This ugly check makes that + * but only applies to the latter. This ugly check makes that * distinction for us. */ if (object_dynamic_cast(OBJECT(sch->driver_data), TYPE_S390_CCW)) { diff --git a/hw/usb/u2f.h b/hw/usb/u2f.h index db30f3586b..a408a82927 100644 --- a/hw/usb/u2f.h +++ b/hw/usb/u2f.h @@ -74,7 +74,7 @@ typedef struct U2FKeyState { =20 /* * API to be used by the U2F key device variants (i.e. hw/u2f-*.c) - * to interact with the the U2F key base device (i.e. hw/u2f.c) + * to interact with the U2F key base device (i.e. hw/u2f.c) */ void u2f_send_to_guest(U2FKeyState *key, const uint8_t packet[U2FHID_PACKET_SIZE]); diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 98774e2835..785dd5a56e 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -386,7 +386,7 @@ bool qdev_realize_and_unref(DeviceState *dev, BusState = *bus, Error **errp); * * - unrealize any child buses by calling qbus_unrealize() * (this will recursively unrealize any devices on those buses) - * - call the the unrealize method of @dev + * - call the unrealize method of @dev * * The device can then be freed by causing its reference count to go * to zero. diff --git a/include/user/safe-syscall.h b/include/user/safe-syscall.h index 61a04e2b5a..ddceef12e2 100644 --- a/include/user/safe-syscall.h +++ b/include/user/safe-syscall.h @@ -70,7 +70,7 @@ * If the host libc is used then the implementation will appear to work * most of the time, but there will be a race condition where a * signal could arrive just before we make the host syscall inside libc, - * and then then guest syscall will not correctly be interrupted. + * and then the guest syscall will not correctly be interrupted. * Instead the implementation of the guest syscall can use the safe_syscall * function but otherwise just return the result or errno in the usual * way; the main loop code will take care of restarting the syscall diff --git a/linux-user/i386/cpu_loop.c b/linux-user/i386/cpu_loop.c index 492701dd9a..42837399bc 100644 --- a/linux-user/i386/cpu_loop.c +++ b/linux-user/i386/cpu_loop.c @@ -137,7 +137,7 @@ static void emulate_vsyscall(CPUX86State *env) } =20 /* - * Validate the the pointer arguments. + * Validate the pointer arguments. */ switch (syscall) { case TARGET_NR_gettimeofday: diff --git a/pc-bios/s390-ccw/virtio-scsi.c b/pc-bios/s390-ccw/virtio-scsi.c index 2c8d0f3097..45256b3fdb 100644 --- a/pc-bios/s390-ccw/virtio-scsi.c +++ b/pc-bios/s390-ccw/virtio-scsi.c @@ -195,7 +195,7 @@ static bool scsi_read_capacity(VDev *vdev, /* virtio-scsi routines */ =20 /* - * Tries to locate a SCSI device and and adds the information for the found + * Tries to locate a SCSI device and adds the information for the found * device to the vdev->scsi_device structure. * Returns 0 if SCSI device could be located, or a error code < 0 otherwise */ diff --git a/python/Makefile b/python/Makefile index 3334311362..b170708398 100644 --- a/python/Makefile +++ b/python/Makefile @@ -29,7 +29,7 @@ help: @echo " Performs no environment setup of any kind." @echo "" @echo "make develop:" - @echo " Install deps needed for for 'make check'," + @echo " Install deps needed for 'make check'," @echo " and install the qemu package in editable mode." @echo " (Can be used in or outside of a venv.)" @echo "" diff --git a/python/qemu/utils/__init__.py b/python/qemu/utils/__init__.py index 9fb273b13d..017cfdcda7 100644 --- a/python/qemu/utils/__init__.py +++ b/python/qemu/utils/__init__.py @@ -79,7 +79,7 @@ def add_visual_margin( :param content: The text to wrap and decorate. :param width: The number of columns to use, including for the decoration - itself. The default (None) uses the the available width of the + itself. The default (None) uses the available width of the current terminal, or a fallback of 72 lines. A negative number subtracts a fixed-width from the default size. The default obeys the COLUMNS environment variable, if set. diff --git a/target/arm/translate.c b/target/arm/translate.c index 6617de775f..73d1faf917 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -8056,7 +8056,7 @@ static TCGv_i32 op_addr_block_pre(DisasContext *s, ar= g_ldst_block *a, int n) * If the writeback is incrementing SP rather than * decrementing it, and the initial SP is below the * stack limit but the final written-back SP would - * be above, then then we must not perform any memory + * be above, then we must not perform any memory * accesses, but it is IMPDEF whether we generate * an exception. We choose to do so in this case. * At this point 'addr' is the lowest address, so diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 6a57ef13af..194b5a31af 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -3632,7 +3632,7 @@ static const X86CPUDefinition builtin_x86_defs[] =3D { CPUID_7_0_EDX_CORE_CAPABILITY, .features[FEAT_CORE_CAPABILITY] =3D MSR_CORE_CAP_SPLIT_LOCK_DETECT, - /* XSAVES is is added in version 3 */ + /* XSAVES is added in version 3 */ .features[FEAT_XSAVE] =3D CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | CPUID_XSAVE_XGETBV1, diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index d52206ba4d..cb04e4b3ad 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1652,7 +1652,7 @@ static void tcg_out_branch(TCGContext *s, int call, c= onst tcg_insn_unit *dest) } else { /* rip-relative addressing into the constant pool. This is 6 + 8 =3D 14 bytes, as compared to using an - an immediate load 10 + 6 =3D 16 bytes, plus we may + immediate load 10 + 6 =3D 16 bytes, plus we may be able to re-use the pool constant for more calls. */ tcg_out_opc(s, OPC_GRP5, 0, 0, 0); tcg_out8(s, (call ? EXT5_CALLN_Ev : EXT5_JMPN_Ev) << 3 | 5); diff --git a/tests/qtest/microbit-test.c b/tests/qtest/microbit-test.c index 04e199ec33..6cc1f5d932 100644 --- a/tests/qtest/microbit-test.c +++ b/tests/qtest/microbit-test.c @@ -449,9 +449,9 @@ static void test_nrf51_timer(void) timer_set_prescaler(qts, 0); /* Swept over in first step */ timer_set_cc(qts, 0, 2); - /* Barely miss on first step */ + /* Barely miss in first step */ timer_set_cc(qts, 1, 162); - /* Spot on on third step */ + /* Spot on in third step */ timer_set_cc(qts, 2, 480); =20 timer_assert_events(qts, 0, 0, 0, 0); diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c index a52eacf82e..9368e292e4 100644 --- a/tools/virtiofsd/fuse_virtio.c +++ b/tools/virtiofsd/fuse_virtio.c @@ -379,7 +379,7 @@ int virtio_send_data_iov(struct fuse_session *se, struc= t fuse_chan *ch, copy_iov(iov, count, in_sg, in_num, iov_len); =20 /* - * Build a copy of the the in_sg iov so we can skip bits in it, + * Build a copy of the in_sg iov so we can skip bits in it, * including changing the offsets */ in_sg_cpy =3D g_new(struct iovec, in_num); --=20 2.36.1 From nobody Sat Feb 7 23:34:11 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1656948508; cv=none; d=zohomail.com; s=zohoarc; b=IFRxVmJSXwrYR1aKFjV95aCj5nIpm+I8IGq3UF4BushugBCu8XQHEt+IqPVoIJIkVnuQI984Q/t+xL4mBn5C2ORU61avZK6OTz33oRhW3BfNxvwkRlmkUCPS/S7h4ktGn8C6DiVrmI1HFQQeP2SFHxVXdPoDMYwPaXFOKHcnajI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656948508; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CKkjsT0N+2AV09zWSzaEt8xr3snRI2NIlh81+SM9ElA=; b=Lc5/gHz3uxEdHiuzJA1ca0RbtKYnCruuwbnrU3iFVsUmmQWFYuCxijhsyR8DCc2HZoYBtCG2R2QVDwEQBWfWObUtRasDS2B/a9yNrY0D7v2gasjXEoISrwStgwvA/MZYv4lmabKS7+mGK+CaHUvE5cy9eKk8yIqWNl/ro35C+ws= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656948508173178.14773283110412; Mon, 4 Jul 2022 08:28:28 -0700 (PDT) Received: from localhost ([::1]:48428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8Nzt-0006qG-QB for importer@patchew.org; Mon, 04 Jul 2022 11:28:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Nuz-0005Ia-EN for qemu-devel@nongnu.org; Mon, 04 Jul 2022 11:23:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60888) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Nux-0002N6-W5 for qemu-devel@nongnu.org; Mon, 04 Jul 2022 11:23:21 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-336-2b_hMFgxNSKsUNA01CU8KA-1; Mon, 04 Jul 2022 11:23:18 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A43123C0CD47; Mon, 4 Jul 2022 15:23:17 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id 51727C28100; Mon, 4 Jul 2022 15:23:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656948199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CKkjsT0N+2AV09zWSzaEt8xr3snRI2NIlh81+SM9ElA=; b=Hhw5bxULmULZwOE3nPEN7n3Te37h3iLceuc2XRp4jFUy241ssy7XerPv+qhOLwjvOoF7pg zuReFnvVgjXRnF8opxdNd6EteAy5d+LOtGu7nSIeR8BdE7/J+tpzkGnkEmx1nBoSB56RC9 VPKuTHXhRZXgkjQ5dhwsOvfIN1RhQtc= X-MC-Unique: 2b_hMFgxNSKsUNA01CU8KA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 5/7] tests/style: check for commonly doubled up words Date: Mon, 4 Jul 2022 16:23:01 +0100 Message-Id: <20220704152303.760983-6-berrange@redhat.com> In-Reply-To: <20220704152303.760983-1-berrange@redhat.com> References: <20220704152303.760983-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656948509802100001 This style check looks for cases where the words the then in an on if is it but for or at and do to are repeated in a sentence. It doesn't use the simple regex match logic because it needs to match repeats across lines, so has a custom crafted rule. Signed-off-by: Daniel P. Berrang=C3=A9 --- tests/style-excludes.mak | 12 ++++++++++++ tests/style.mak | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/tests/style-excludes.mak b/tests/style-excludes.mak index 32c0e9c328..931dd03a64 100644 --- a/tests/style-excludes.mak +++ b/tests/style-excludes.mak @@ -2,3 +2,15 @@ # # Filenames that should be excluded from specific # style checks performed by style.mak + +exclude_file_name_regexp--sc_prohibit_doubled_word =3D \ + disas/sparc\.c \ + hw/char/terminal3270\.c \ + include/crypto/afsplit\.h \ + qemu-options\.hx \ + scripts/checkpatch\.pl \ + target/s390x/tcg/insn-data\.def \ + pc-bios/slof\.bin \ + tests/qemu-iotests/142(\.out)? \ + tests/qtest/arm-cpu-features\.c \ + ui/cursor\.c diff --git a/tests/style.mak b/tests/style.mak index ae658395c9..4056bde619 100644 --- a/tests/style.mak +++ b/tests/style.mak @@ -28,3 +28,27 @@ sc_int_assign_bool: @prohibit=3D'\.*=3D *(true|false)\b' \ halt=3D'use bool type for boolean values' \ $(_sc_search_regexp) + +prohibit_doubled_words_ =3D \ + the then in an on if is it but for or at and do to can +# expand the regex before running the check to avoid using expensive captu= res +prohibit_doubled_word_expanded_ =3D \ + $(join $(prohibit_doubled_words_),$(addprefix \s+,$(prohibit_doubled_w= ords_))) +prohibit_doubled_word_RE_ ?=3D \ + /\b(?:$(subst $(_sp),|,$(prohibit_doubled_word_expanded_)))\b/gims +prohibit_doubled_word_ =3D \ + -e 'while ($(prohibit_doubled_word_RE_))' \ + $(perl_filename_lineno_text_) + +# Define this to a regular expression that matches +# any filename:dd:match lines you want to ignore. +# The default is to ignore no matches. +ignore_doubled_word_match_RE_ ?=3D ^$$ + +sc_prohibit_doubled_word: + @$(VC_LIST_EXCEPT) \ + | xargs perl -n -0777 $(prohibit_doubled_word_) \ + | $(GREP) -vE '$(ignore_doubled_word_match_RE_)' \ + | $(GREP) . \ + && { echo '$(ME): doubled words' 1>&2; exit 1; } \ + || : --=20 2.36.1 From nobody Sat Feb 7 23:34:11 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1656948537; cv=none; d=zohomail.com; s=zohoarc; b=jXIr0EJ/TB60jliLU8fSeT3V0+/TH9NFYTyrcn1xPZHcFmb7q99zUcAeeaxOU6M3PzjoIZ/MP7SNnKbMLN+A4D0/NffIQyzb39bRRMjmN22uYluvsjKhKbNoGrlLrkv2TLtzWn6rEkMMSB/kTE+yt80TMTdOBfpb7+oP28NJ3sU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656948537; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4fta47YUlsilQV6ge0djhhSmzriViuvan5Fy4AELF3k=; b=TYIhUfjOJe7n2G+KR6TMe/d1anjVKrVXvxlcjv/PlGw7FjH58hYJ6rYc6+uuJJgQU2i69iCNzU2Y/RiKQhEdfriwpYK4B6OHOVscgNrdg2jGoDlOJXJ+9aC+nAMhENGtVIJFMkMjz9XR2ZCbOH3U4FrYne8/0itWoSkIw4rB6rk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656948537680621.5894225902044; Mon, 4 Jul 2022 08:28:57 -0700 (PDT) Received: from localhost ([::1]:49788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8O0N-0007kl-AK for importer@patchew.org; Mon, 04 Jul 2022 11:28:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Nv4-0005Xb-8R for qemu-devel@nongnu.org; Mon, 04 Jul 2022 11:23:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:30843) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Nv1-0002Oc-NG for qemu-devel@nongnu.org; Mon, 04 Jul 2022 11:23:26 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-557-d0zuZbO7OuW1ZlOPXkYeQA-1; Mon, 04 Jul 2022 11:23:20 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 95F56801755; Mon, 4 Jul 2022 15:23:19 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id EDF12C28100; Mon, 4 Jul 2022 15:23:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656948203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4fta47YUlsilQV6ge0djhhSmzriViuvan5Fy4AELF3k=; b=bMf48K9CRuaMq03DZGn95P7P22CcU3+F0k1OVwZZHZZ3Bh8oClHv+3EVhDGdJcEW01uctC 8+rFiRHlURv9zCVax0EbdvzYpXE0TtQIz0xt0puLXlqiXOfDin0GJnIZREYbW+NfQyDGnA GCbs8dYqZmc73IkUOA5ZsF1PpbavEf8= X-MC-Unique: d0zuZbO7OuW1ZlOPXkYeQA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 6/7] misc: ensure qemu/osdep.h is included in all .c files Date: Mon, 4 Jul 2022 16:23:02 +0100 Message-Id: <20220704152303.760983-7-berrange@redhat.com> In-Reply-To: <20220704152303.760983-1-berrange@redhat.com> References: <20220704152303.760983-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656948539764100001 A few files relied on qemu/osdep.h being included via a common header. Another file didn't need it because it was actually an included file, so ought to have been named .c.inc Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Warner Losh --- bsd-user/arm/signal.c | 2 ++ bsd-user/arm/target_arch_cpu.c | 3 +++ bsd-user/{elfcore.c =3D> elfcore.c.inc} | 0 bsd-user/elfload.c | 2 +- bsd-user/freebsd/os-sys.c | 2 ++ bsd-user/i386/signal.c | 2 ++ bsd-user/qemu.h | 1 - bsd-user/x86_64/signal.c | 2 ++ crypto/rsakey.c | 1 + qga/cutils.c | 2 ++ 10 files changed, 15 insertions(+), 2 deletions(-) rename bsd-user/{elfcore.c =3D> elfcore.c.inc} (100%) diff --git a/bsd-user/arm/signal.c b/bsd-user/arm/signal.c index 2b1dd745d1..eca20ac4d7 100644 --- a/bsd-user/arm/signal.c +++ b/bsd-user/arm/signal.c @@ -17,6 +17,8 @@ * along with this program; if not, see . */ =20 +#include "qemu/osdep.h" + #include "qemu.h" =20 /* diff --git a/bsd-user/arm/target_arch_cpu.c b/bsd-user/arm/target_arch_cpu.c index 02bf9149d5..186cf43fb9 100644 --- a/bsd-user/arm/target_arch_cpu.c +++ b/bsd-user/arm/target_arch_cpu.c @@ -16,6 +16,9 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ + +#include "qemu/osdep.h" + #include "target_arch.h" =20 void target_cpu_set_tls(CPUARMState *env, target_ulong newtls) diff --git a/bsd-user/elfcore.c b/bsd-user/elfcore.c.inc similarity index 100% rename from bsd-user/elfcore.c rename to bsd-user/elfcore.c.inc diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index f8edb22f2a..1717a454dc 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -121,7 +121,7 @@ static void bswap_note(struct elf_note *en) { } =20 #endif /* ! BSWAP_NEEDED */ =20 -#include "elfcore.c" +#include "elfcore.c.inc" =20 /* * 'copy_elf_strings()' copies argument/envelope strings from user diff --git a/bsd-user/freebsd/os-sys.c b/bsd-user/freebsd/os-sys.c index 309e27b9d6..1eab1be6f6 100644 --- a/bsd-user/freebsd/os-sys.c +++ b/bsd-user/freebsd/os-sys.c @@ -17,6 +17,8 @@ * along with this program; if not, see . */ =20 +#include "qemu/osdep.h" + #include "qemu.h" #include "target_arch_sysarch.h" =20 diff --git a/bsd-user/i386/signal.c b/bsd-user/i386/signal.c index 5dd975ce56..db5b774213 100644 --- a/bsd-user/i386/signal.c +++ b/bsd-user/i386/signal.c @@ -17,6 +17,8 @@ * along with this program; if not, see . */ =20 +#include "qemu/osdep.h" + #include "qemu.h" =20 /* diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index be6105385e..0ceecfb6df 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -17,7 +17,6 @@ #ifndef QEMU_H #define QEMU_H =20 -#include "qemu/osdep.h" #include "cpu.h" #include "qemu/units.h" #include "exec/cpu_ldst.h" diff --git a/bsd-user/x86_64/signal.c b/bsd-user/x86_64/signal.c index c3875bc4c6..217f9ceb66 100644 --- a/bsd-user/x86_64/signal.c +++ b/bsd-user/x86_64/signal.c @@ -16,6 +16,8 @@ * along with this program; if not, see . */ =20 +#include "qemu/osdep.h" + #include "qemu.h" =20 /* diff --git a/crypto/rsakey.c b/crypto/rsakey.c index cc40e072f0..dcdbd9ec57 100644 --- a/crypto/rsakey.c +++ b/crypto/rsakey.c @@ -19,6 +19,7 @@ * */ =20 +#include "qemu/osdep.h" #include "rsakey.h" =20 void qcrypto_akcipher_rsakey_free(QCryptoAkCipherRSAKey *rsa_key) diff --git a/qga/cutils.c b/qga/cutils.c index b8e142ef64..c53dd418c7 100644 --- a/qga/cutils.c +++ b/qga/cutils.c @@ -2,6 +2,8 @@ * This work is licensed under the terms of the GNU GPL, version 2 or late= r. * See the COPYING file in the top-level directory. */ + +#include "qemu/osdep.h" #include "cutils.h" =20 #include "qapi/error.h" --=20 2.36.1 From nobody Sat Feb 7 23:34:11 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1656948454; cv=none; d=zohomail.com; s=zohoarc; b=EH0CfCvgwLo2JW1Cn0vr7HdspI8EJDy6SjfTx3oIk9h6TdhLziMAoI0ta4nqM90DXb5VNBdjkMizhXUT8TeVyCW82i580/1P93x9Gosz9DqVWFhvZzp4blg6X+xfPlRg5iKE523MHmnw+q9rFFIOVX5f563wDNY9gP+HG5yihn4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656948454; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Cz3FLXYsv9LD+2zT1u+KWE/qqaCdb6vlf39nVdM7GxM=; b=iw9vJMMSI3mqNrYnXD1lQKXdayRvW3iA4Zu5NHXtTwGRc8A1hEwC91B6pdPGTDVtRN04c/jDBr5SnXjAKq3IdoaeM7dsKfe5YxPPBCPcK1bJHwHGwbb3/TqO4JrDEdYJMWd4srfksBKItjtJV4LrPiXyEh49x3Dn48P1b9dFD3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656948454040308.78621470039207; Mon, 4 Jul 2022 08:27:34 -0700 (PDT) Received: from localhost ([::1]:46294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8Nz2-0005Mr-Uk for importer@patchew.org; Mon, 04 Jul 2022 11:27:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Nv2-0005Ti-Ng for qemu-devel@nongnu.org; Mon, 04 Jul 2022 11:23:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34093) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8Nv1-0002NW-AF for qemu-devel@nongnu.org; Mon, 04 Jul 2022 11:23:24 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-218-wOXADXa0P4Sc1r3WmuatmQ-1; Mon, 04 Jul 2022 11:23:21 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4181D185A7B2; Mon, 4 Jul 2022 15:23:21 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id D77EBC28100; Mon, 4 Jul 2022 15:23:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656948202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cz3FLXYsv9LD+2zT1u+KWE/qqaCdb6vlf39nVdM7GxM=; b=XLEmuN5uc+GrYYiXdcTbm+upiOP1fjlDCRTEj5lrngVthyBbWHQRlREQ8d0INE/gSZcx0U FtxFnJSu9BoTPZ7oqjAuPNDXaRQobYTSEDRD+IU4PxeiPXUhuQrgNGZGSuLX9YFccAg1Mt D9KnpVyhQ8TxNtsRCZ9atv1uMF6Rq0M= X-MC-Unique: wOXADXa0P4Sc1r3WmuatmQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 7/7] tests/style: check qemu/osdep.h is included in all .c files Date: Mon, 4 Jul 2022 16:23:03 +0100 Message-Id: <20220704152303.760983-8-berrange@redhat.com> In-Reply-To: <20220704152303.760983-1-berrange@redhat.com> References: <20220704152303.760983-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656948454966100001 Signed-off-by: Daniel P. Berrang=C3=A9 --- tests/style-excludes.mak | 17 +++++++++++++++++ tests/style.mak | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/tests/style-excludes.mak b/tests/style-excludes.mak index 931dd03a64..df158e1d9d 100644 --- a/tests/style-excludes.mak +++ b/tests/style-excludes.mak @@ -14,3 +14,20 @@ exclude_file_name_regexp--sc_prohibit_doubled_word =3D \ tests/qemu-iotests/142(\.out)? \ tests/qtest/arm-cpu-features\.c \ ui/cursor\.c + +exclude_file_name_regexp--sc_c_file_osdep_h =3D \ + contrib/plugins/.* \ + linux-user/(mips64|x86_64)/(signal|cpu_loop)\.c \ + pc-bios/.* \ + scripts/coverity-scan/model\.c \ + scripts/xen-detect\.c \ + subprojects/.* \ + target/hexagon/(gen_semantics|gen_dectree_import)\.c \ + target/s390x/gen-features\.c \ + tests/migration/s390x/a-b-bios\.c \ + tests/multiboot/.* \ + tests/plugin/.* \ + tests/tcg/.* \ + tests/uefi-test-tools/.* \ + tests/unit/test-rcu-(simpleq|slist|tailq)\.c \ + tools/ebpf/rss.bpf.c diff --git a/tests/style.mak b/tests/style.mak index 4056bde619..301d978155 100644 --- a/tests/style.mak +++ b/tests/style.mak @@ -52,3 +52,9 @@ sc_prohibit_doubled_word: | $(GREP) . \ && { echo '$(ME): doubled words' 1>&2; exit 1; } \ || : + +sc_c_file_osdep_h: + @require=3D'#include "qemu/osdep.h"' \ + in_vc_files=3D'\.c$$' \ + halt=3D'all C files must include qemu/osdep.h' \ + $(_sc_search_regexp) --=20 2.36.1