From patchwork Fri Dec 31 12:47:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12701958 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B59C5C433F5 for ; Fri, 31 Dec 2021 13:27:29 +0000 (UTC) Received: from localhost ([::1]:39926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HwO-0001kW-HQ for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 08:27:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLJ-0006ln-QO for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:52795) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLI-0000o8-6U for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954947; 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=AG4y2rzxLZGbpvB29+PEEBcSZMHPBx+rIwBTw7mt+eU=; b=bbsCgI0S/TnwcZraEvjSz3RlGMNtlJVplTDe8FYAIt+ZyztLC2pceyIvqvRDnXHjGBojfT 8e5FT+mx9OlBrx6b9itR8RMK4prB5VxQMIM/sKso3e/dmIN4lRPkNJe/ZXsI3pQZxcrWFD 4o7PHVjPZuKjUiOqFpgqt8oMpqAgljo= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-77-y5OGB7qSODaaGfNBGD3Zbg-1; Fri, 31 Dec 2021 07:49:06 -0500 X-MC-Unique: y5OGB7qSODaaGfNBGD3Zbg-1 Received: by mail-wr1-f71.google.com with SMTP id s23-20020adf9797000000b001a24674f0f7so7533537wrb.9 for ; Fri, 31 Dec 2021 04:49:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AG4y2rzxLZGbpvB29+PEEBcSZMHPBx+rIwBTw7mt+eU=; b=hkZ+nrkLshbJifgbuO3zVvfHkyhjWOxSNRcU9pail4kV6AXN26wQJuOH8XN3GQyiW4 sXqRjRrsc7dO6RXUTZBicFF7vGzvpai4JxEIhdNaCU1/qAPENRm3xUOG6WdGGuDU+hm1 6jarWvlgJntfwP8j2UG5oasyAhI/nwiYKtj3CeomSpHNEP8G1owPZgH9Ej1ZFjQ3r7K/ ITwFzCpJjke9EGMMiKJ4w9b+SN/PWgUhvyEH0vMOq/MRimeblLa+tow1LTA+lOYjr5Lt c2U0z7HDDWcIHIuoV8g5MTZfODZcTsC1I1yJIKrl+/0j4ip2LGHaI177BqavuwnJve+K Apbg== X-Gm-Message-State: AOAM531rQazhezMpjsXHg8FQZ67mTu5N/1TVEbSTEkMxCNTKgG6x3Ut+ JHU1/WJofQwkX4ev+VLEhqOjMBtI+5dYT4BhQyV/E7d1Pog6PoEfJ3uofM8W/3Cc2T4LHo6N85r IVb2RMTGeVeRLqlk8LqvPyXnDLGN/la26UorBwxpCVkoAWAXarSE2YSM0F7M35oB3 X-Received: by 2002:a05:600c:2059:: with SMTP id p25mr29424793wmg.151.1640954945227; Fri, 31 Dec 2021 04:49:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJx05hAnb72YWkxkRepho8vs7YnTo9QVVn0H4PymlCOSsxHLImvD4DGOKDMx1FXhptHL1jOISw== X-Received: by 2002:a05:600c:2059:: with SMTP id p25mr29424781wmg.151.1640954945059; Fri, 31 Dec 2021 04:49:05 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id n12sm19710271wmq.30.2021.12.31.04.49.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:49:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 16/20] tests/unit/test-smp-parse: No need to explicitly zero MachineClass members Date: Fri, 31 Dec 2021 13:47:50 +0100 Message-Id: <20211231124754.1005747-17-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: , Cc: Yanan Wang , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yanan Wang The default value of the MachineClass members is 0, which means we don't have to explicitly zero them. Also the value of "mc->smp_props.prefer_sockets" will be taken care of by smp_parse_test(), we don't necessarily need the statement in machine_base_class_init() either. Signed-off-by: Yanan Wang Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211228092221.21068-6-wangyanan55@huawei.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 331719bbc4b..72d83d1bbc9 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -523,8 +523,6 @@ static void machine_base_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); - mc->smp_props.prefer_sockets = true; - mc->name = g_strdup(SMP_MACHINE_NAME); } @@ -534,9 +532,6 @@ static void machine_generic_valid_class_init(ObjectClass *oc, void *data) mc->min_cpus = MIN_CPUS; mc->max_cpus = MAX_CPUS; - - mc->smp_props.dies_supported = false; - mc->smp_props.clusters_supported = false; } static void machine_generic_invalid_class_init(ObjectClass *oc, void *data) @@ -546,9 +541,6 @@ static void machine_generic_invalid_class_init(ObjectClass *oc, void *data) /* Force invalid min CPUs and max CPUs */ mc->min_cpus = 2; mc->max_cpus = 511; - - mc->smp_props.dies_supported = false; - mc->smp_props.clusters_supported = false; } static void machine_with_dies_class_init(ObjectClass *oc, void *data) @@ -559,7 +551,6 @@ static void machine_with_dies_class_init(ObjectClass *oc, void *data) mc->max_cpus = MAX_CPUS; mc->smp_props.dies_supported = true; - mc->smp_props.clusters_supported = false; } static void machine_with_clusters_class_init(ObjectClass *oc, void *data) @@ -570,7 +561,6 @@ static void machine_with_clusters_class_init(ObjectClass *oc, void *data) mc->max_cpus = MAX_CPUS; mc->smp_props.clusters_supported = true; - mc->smp_props.dies_supported = false; } static void test_generic_valid(const void *opaque)