From patchwork Wed Jan 18 11:38:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 45212 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2305973wrn; Wed, 18 Jan 2023 04:23:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXu4AZA8whpqLLJKMjjBHZ1rOAjQiqqEZWZCYSdEwYKaI6WFh2izNV/wiQnzX9TF07KpYRka X-Received: by 2002:a17:906:8154:b0:866:d17a:e50 with SMTP id z20-20020a170906815400b00866d17a0e50mr6558492ejw.70.1674044603391; Wed, 18 Jan 2023 04:23:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674044603; cv=none; d=google.com; s=arc-20160816; b=oAsjk01P4c0oqCWaysheBK4zmaZ0MBgYnf9HXWPvINY/QfIoF3SpNmWlIjbIGABo+U etnFN/MRKfqJdFkQiqb1wqVh+BC56RZ5NjN3Fgw+PtBvQbHAwyzkOjGkCl+5W+XlLhgN 7T6uaIvVrvoUtR/cpnhoP1qfy1xVvoD3WMYKUW76HGzDcPkiR8oc1sK28X+5uTktLbUw Lp538uhK5+9sCM7v4EH2GZzQk596f6xNYsdcgKJz1vpNxN1+O7mdHfO/9vD8uqZwomHN 2PupPUwmSoIp79Hl02XA3rZH1fooDVa2ummMmXou0TtvikBJMS9yAzERmxM+y+U+hHjT RDdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=J4rOdGazLwqJl2droFxjKDvA7hJVxHlo7hiVAnNC8uw=; b=rNUzD6uuyvxV1YNoimLQEdeyD+OxKWi2YtnnHhl7e5aX/iQOGZzLpc3S5ebmkqhZA3 zJOweztvalRaoaHERP9NIKehxyc0jCRYAoDuOituTDciP2sYCwO8xOZ9lYb/WxyG5jVN +uGqvmJLb9FHk1szG5j+/pH0D/yp1lQ+mWZ1uMKmBp1fqS96ANPWJkxA5S+turK7Plso jI/3BjhsqsBkik219g5AgZeUs68jd9ymzH9oRwgmIrzTOHXOmnDETGXef6S4mAGXHArR QVbAfTZKi4xpi54GEiBrcX1oKKwqhbmn8aCDqZEaq1kXoFmTthppHfBfdUO/qS9/bgmS 0Iew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=MxYy96mD; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb8-20020a1709077e8800b00870d15ac2d9si10488592ejc.163.2023.01.18.04.22.59; Wed, 18 Jan 2023 04:23:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=MxYy96mD; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230148AbjARMSB (ORCPT + 99 others); Wed, 18 Jan 2023 07:18:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbjARMQX (ORCPT ); Wed, 18 Jan 2023 07:16:23 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5A4C88745; Wed, 18 Jan 2023 03:38:41 -0800 (PST) Date: Wed, 18 Jan 2023 11:38:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1674041920; h=from:from:sender:sender:reply-to: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=J4rOdGazLwqJl2droFxjKDvA7hJVxHlo7hiVAnNC8uw=; b=MxYy96mDPDSBhRSjNdIee+SYI+8E/4axNZH9efBsFaI4/lHEVeaPWxh3hZcwipzKASYxbH JGHDVgINZp0A/wwBdeSySAbQXaRdWR9F9U7d0L6ym4iEI8rQPXUDvKVqDX+qyeZKsrPTJU nSf1923Iud6rvn/gdz+XY1hYvvY7gjaHv2z6nG3ioo49JZ7c3A0ZVgccxERjqLu1HBobUd QdODkQheO6OdqKebXnTgrrys5qxAo+kJ2mSbQXAoSUtN7I1FvU9j4qswBtdTstnNF3prpb jxYLAd9X/sVvplEW26iOnuztGXVEET3WPiTStUF4DOI/CMCZLquweZNGXIE1Lw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1674041920; h=from:from:sender:sender:reply-to: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=J4rOdGazLwqJl2droFxjKDvA7hJVxHlo7hiVAnNC8uw=; b=DNXEYM961ypvgCEXd2vf3uV8GGcJzFJ5ajINOwdMXyq0zp7eGmHl4+wHCvGwu1jQnOJmQD QYHEP6JR9q4s8YAQ== From: "tip-bot2 for Guangju Wang[baidu]" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/microcode] x86/microcode: Use the DEVICE_ATTR_RO() macro Cc: "Guangju Wang[baidu]" , Ingo Molnar , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230118023554.1898-1-wgj900@163.com> References: <20230118023554.1898-1-wgj900@163.com> MIME-Version: 1.0 Message-ID: <167404192010.4906.907537462344732818.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755362993723008059?= X-GMAIL-MSGID: =?utf-8?q?1755362993723008059?= The following commit has been merged into the x86/microcode branch of tip: Commit-ID: 59047d942bedc4ce88a2121a9f9e656b9532dd30 Gitweb: https://git.kernel.org/tip/59047d942bedc4ce88a2121a9f9e656b9532dd30 Author: Guangju Wang[baidu] AuthorDate: Wed, 18 Jan 2023 10:35:54 +08:00 Committer: Ingo Molnar CommitterDate: Wed, 18 Jan 2023 12:02:20 +01:00 x86/microcode: Use the DEVICE_ATTR_RO() macro Use DEVICE_ATTR_RO() helper instead of open-coded DEVICE_ATTR(), which makes the code a bit shorter and easier to read. No change in functionality. Signed-off-by: Guangju Wang[baidu] Signed-off-by: Ingo Molnar Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230118023554.1898-1-wgj900@163.com --- arch/x86/kernel/cpu/microcode/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index 712aaff..99abb31 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -507,7 +507,7 @@ static ssize_t version_show(struct device *dev, return sprintf(buf, "0x%x\n", uci->cpu_sig.rev); } -static ssize_t pf_show(struct device *dev, +static ssize_t processor_flags_show(struct device *dev, struct device_attribute *attr, char *buf) { struct ucode_cpu_info *uci = ucode_cpu_info + dev->id; @@ -515,8 +515,8 @@ static ssize_t pf_show(struct device *dev, return sprintf(buf, "0x%x\n", uci->cpu_sig.pf); } -static DEVICE_ATTR(version, 0444, version_show, NULL); -static DEVICE_ATTR(processor_flags, 0444, pf_show, NULL); +static DEVICE_ATTR_RO(version); +static DEVICE_ATTR_RO(processor_flags); static struct attribute *mc_default_attrs[] = { &dev_attr_version.attr,