Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1668783ybz; Thu, 16 Apr 2020 13:19:19 -0700 (PDT) X-Google-Smtp-Source: APiQypJu8DGeb+h1ZYUDG41M18oXAX3aTd+WCuEr3gR0oytnMD5V+QvVxWSIjiYV0AdNXNl+PmbV X-Received: by 2002:a17:906:6d95:: with SMTP id h21mr11293420ejt.66.1587068359410; Thu, 16 Apr 2020 13:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587068359; cv=none; d=google.com; s=arc-20160816; b=V7sCBewPP9XmugP4J/C4dyZAeat0e0J8ViqBSJhe8iglFIgymyex5vQU6zusH/FUyQ 2jX+ietb8jw5UJpBKKS5a2AYHm1hRnbnAE+2W7UAB39q/TLZgH21jU9AnaAPx4eHEeoe harTJkS/HJBwyefNnUJpcQm2MNp+QQd94CmbMBvKMpp2aaZ94dmBOI6N/b8m8WbiePAX LipJKGBbf4fgcckev5/SsOR1lO2yb1kQehTH7u+lCLD34Zi7vdDJp9/DtLicBdrBVKB2 i/0G0BKjh6ajS2hd5A7X+d/RSUz5IQQxB9CbPyoCYbVHE2CMyMi0RIZwBIc07FvgqvLS 54YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TnT+GCU7HDH4vCCfg1Uj55ugxrjWcafV+oKbg5PkL4A=; b=hTu4QzJ/xZHjtbvNI4mZT6f8cRp0DuLpzIISReu94vo2kVIOhFlTbIbFNzVN5Vzaz+ ufncZEgOREURSuQW5IB4qf/zoyAttoR6QUgkqcS0vN7AQqUsZs1iV96EET/sbhh1Yjpj fteKMTBJ8b55HBrmZAjXDd5NU3pmUCK55N55BwZ6E2D6qxQduh5IS3dorxDIRL+aVM49 Q1gDV1A48jhiLGb98kQwkIfkzyLE4NOJ1RhJ9f6nGF1jl93/VxTbKf7DLkJU6aIlhQNH oYwERcdDOVIIOyg6WSIP/ptYcwWw0RNYJKi512PCq1+zkZn4Hq31NjPltcDXyhnnX4wd 9ynw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pOfowzlT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pj27si10296466ejb.196.2020.04.16.13.18.54; Thu, 16 Apr 2020 13:19:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pOfowzlT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393650AbgDPOLX (ORCPT + 99 others); Thu, 16 Apr 2020 10:11:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:33310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2898656AbgDPNrQ (ORCPT ); Thu, 16 Apr 2020 09:47:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6697121734; Thu, 16 Apr 2020 13:47:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587044835; bh=vHr6g5MwzQjKMd6VRdS/hjjFnOfpLL/Nb7slM5ESHiA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pOfowzlTB+yf2rJ4dmrVwwwotZcl5AtLtoIjUSxl0kdhfsZ58IWeBy3hlV4aIDwnj 5H/Hwyq3sOY8i2WGo+/qHcaWrlI1+CQbZM5YFuWv0pderE5SnI4yeTVwNdw7uGCpfj 8qf1vd0fcsmS7DSCfRQI9gPsOesamvD8dUZu6hyQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Thomas Gleixner Subject: [PATCH 5.4 120/232] x86/tsc_msr: Use named struct initializers Date: Thu, 16 Apr 2020 15:23:34 +0200 Message-Id: <20200416131330.114238768@linuxfoundation.org> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200416131316.640996080@linuxfoundation.org> References: <20200416131316.640996080@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede commit 812c2d7506fde7cdf83cb2532810a65782b51741 upstream. Use named struct initializers for the freq_desc struct-s initialization and change the "u8 msr_plat" to a "bool use_msr_plat" to make its meaning more clear instead of relying on a comment to explain it. Signed-off-by: Hans de Goede Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20200223140610.59612-1-hdegoede@redhat.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/tsc_msr.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) --- a/arch/x86/kernel/tsc_msr.c +++ b/arch/x86/kernel/tsc_msr.c @@ -22,10 +22,10 @@ * read in MSR_PLATFORM_ID[12:8], otherwise in MSR_PERF_STAT[44:40]. * Unfortunately some Intel Atom SoCs aren't quite compliant to this, * so we need manually differentiate SoC families. This is what the - * field msr_plat does. + * field use_msr_plat does. */ struct freq_desc { - u8 msr_plat; /* 1: use MSR_PLATFORM_INFO, 0: MSR_IA32_PERF_STATUS */ + bool use_msr_plat; u32 freqs[MAX_NUM_FREQS]; }; @@ -35,31 +35,39 @@ struct freq_desc { * by MSR based on SDM. */ static const struct freq_desc freq_desc_pnw = { - 0, { 0, 0, 0, 0, 0, 99840, 0, 83200 } + .use_msr_plat = false, + .freqs = { 0, 0, 0, 0, 0, 99840, 0, 83200 }, }; static const struct freq_desc freq_desc_clv = { - 0, { 0, 133200, 0, 0, 0, 99840, 0, 83200 } + .use_msr_plat = false, + .freqs = { 0, 133200, 0, 0, 0, 99840, 0, 83200 }, }; static const struct freq_desc freq_desc_byt = { - 1, { 83300, 100000, 133300, 116700, 80000, 0, 0, 0 } + .use_msr_plat = true, + .freqs = { 83300, 100000, 133300, 116700, 80000, 0, 0, 0 }, }; static const struct freq_desc freq_desc_cht = { - 1, { 83300, 100000, 133300, 116700, 80000, 93300, 90000, 88900, 87500 } + .use_msr_plat = true, + .freqs = { 83300, 100000, 133300, 116700, 80000, 93300, 90000, + 88900, 87500 }, }; static const struct freq_desc freq_desc_tng = { - 1, { 0, 100000, 133300, 0, 0, 0, 0, 0 } + .use_msr_plat = true, + .freqs = { 0, 100000, 133300, 0, 0, 0, 0, 0 }, }; static const struct freq_desc freq_desc_ann = { - 1, { 83300, 100000, 133300, 100000, 0, 0, 0, 0 } + .use_msr_plat = true, + .freqs = { 83300, 100000, 133300, 100000, 0, 0, 0, 0 }, }; static const struct freq_desc freq_desc_lgm = { - 1, { 78000, 78000, 78000, 78000, 78000, 78000, 78000, 78000 } + .use_msr_plat = true, + .freqs = { 78000, 78000, 78000, 78000, 78000, 78000, 78000, 78000 }, }; static const struct x86_cpu_id tsc_msr_cpu_ids[] = { @@ -91,7 +99,7 @@ unsigned long cpu_khz_from_msr(void) return 0; freq_desc = (struct freq_desc *)id->driver_data; - if (freq_desc->msr_plat) { + if (freq_desc->use_msr_plat) { rdmsr(MSR_PLATFORM_INFO, lo, hi); ratio = (lo >> 8) & 0xff; } else {