Message ID | 20230131063928.388035-7-ajd@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2593004wrn; Mon, 30 Jan 2023 22:41:40 -0800 (PST) X-Google-Smtp-Source: AK7set++CmpcTRmU8FVrwR9O3kqg7P5tbSdBEpPr06IHw2wRc+Xs2vSUSk2go55aDY9GqX6ekCy1 X-Received: by 2002:a05:6a00:1516:b0:593:af5d:7c2f with SMTP id q22-20020a056a00151600b00593af5d7c2fmr10046829pfu.11.1675147299882; Mon, 30 Jan 2023 22:41:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675147299; cv=none; d=google.com; s=arc-20160816; b=FakUC3sheL0D02AbmzZPxu0hxErrEoeC0OI3syXw084FHt6P1UE2jp7EqxEKqEUoaz LQSkVaX3SfBpEF/uJO96e5uqoXd2gB6iE3JBnRGL05ergsclmQT57JYcD9xc22NHT2Dq eqt+gI/oYdvUMyVKD2m3Z0NiAXMWv43s14GRr7QSUwacwqySK+KX21Vley2TNP0HkOLD Q0s5lNR2aXSspZWRDs1lbA2xaeEx0PvaErfHO3dNbvBgzT3mXgEjxW+oAXKxnL3zj7bn VGc95/bs9YtXPHxN6nuNwF89lhUt0BUNJIyaa2Se6XRRVxIArk4NYYMdlsyllLaa99RD 3wlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mU3l5gO7IIw2YUOTU0r6w1mv2TStdSV2FkkMkgfpiNs=; b=uq7m9+ZWy2/4zIG10DRAF4nok8HlPrJC8R3/BauvBqRm0sohMRyVeJ9xA1RzA3XCtP gVBaY128L+XVINklUINGE7i3Gh/9q9Id4PIOdL8gsIMVkpZU2XHqTcfurCyYNKY/+raq EBf695myhMHuteLAGIcm1gUKVuZWOf0MKE34mqa8pOSEQU0hsvAPT9N7+s5f7gSlYoTj Y+GcCacv9Z+qMpXJkuJPHDhGJhyJG95coBmmKiMeNeLjBynUVTQTB7qZk5GItXWcu1LA vNgWeNPwdTRFS/v9bGJ1j8cttMp6zArStm+Kwz2wdShJXKgcVqv7/lmXTzkwhu+eoZSE Q6yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=NwhOAhMc; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u127-20020a626085000000b00589605fb097si9221553pfb.224.2023.01.30.22.41.27; Mon, 30 Jan 2023 22:41:39 -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=@ibm.com header.s=pp1 header.b=NwhOAhMc; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230399AbjAaGkr (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Tue, 31 Jan 2023 01:40:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230205AbjAaGkY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 31 Jan 2023 01:40:24 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9005E3D925; Mon, 30 Jan 2023 22:40:23 -0800 (PST) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30V6Tm5k026293; Tue, 31 Jan 2023 06:40:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=mU3l5gO7IIw2YUOTU0r6w1mv2TStdSV2FkkMkgfpiNs=; b=NwhOAhMcnnBriVjx5f7J5A7kLTZXQ4HCs0D2QQAlxP8jQfvknone7XMXcOCGpPiWzyrx oCFdrSHMWTMn4lDUvrSu2KF42uLdDGQXkKpsrjkOk9ZGTk3S2viXBc0wXlgHS6vSffDJ fnVO16d5rq9wU9Ds8Omrj0TbKc/dgkXfxG0jldf5m6MUQqkWukOn5xsN4saxyNShGH+D Xqlir400rgr3TzSXM4azJ1i+tUm5moZ03De1qya3e+Rw2vA/aKGkW/58o3bXDWvcaZgl T7WwRYfbfY1n1M4gVChG4lpX6GjMfddcGYtGOEg//22cKGAUBDIuVeL86WenXZta5X55 vA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3news607jv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Jan 2023 06:40:14 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 30V6VmCe001199; Tue, 31 Jan 2023 06:40:14 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3news607hn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Jan 2023 06:40:13 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 30UK70WJ032360; Tue, 31 Jan 2023 06:40:11 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3ncvuqt7s1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Jan 2023 06:40:11 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 30V6e81c42336662 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 31 Jan 2023 06:40:09 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DCE2120043; Tue, 31 Jan 2023 06:40:08 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5D6422004B; Tue, 31 Jan 2023 06:40:08 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 31 Jan 2023 06:40:08 +0000 (GMT) Received: from jarvis-ozlabs-ibm-com.au.ibm.com (unknown [9.192.255.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 39378606E6; Tue, 31 Jan 2023 17:40:04 +1100 (AEDT) From: Andrew Donnellan <ajd@linux.ibm.com> To: linuxppc-dev@lists.ozlabs.org, linux-integrity@vger.kernel.org Cc: ruscur@russell.cc, bgray@linux.ibm.com, nayna@linux.ibm.com, gcwilson@linux.ibm.com, gjoyce@linux.ibm.com, brking@linux.ibm.com, stefanb@linux.ibm.com, sudhakar@linux.ibm.com, erichte@linux.ibm.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, zohar@linux.ibm.com, joel@jms.id.au, npiggin@gmail.com Subject: [PATCH v5 06/25] powerpc/secvar: Use sysfs_emit() instead of sprintf() Date: Tue, 31 Jan 2023 17:39:09 +1100 Message-Id: <20230131063928.388035-7-ajd@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230131063928.388035-1-ajd@linux.ibm.com> References: <20230131063928.388035-1-ajd@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ROpEy-d2mBNc_fk9iriqNEhkdIXrPFEe X-Proofpoint-ORIG-GUID: juM0vAUvM-APcfjEJQ_ggCl4CksqyIH6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-31_02,2023-01-30_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 mlxscore=0 suspectscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 spamscore=0 clxscore=1015 mlxlogscore=891 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301310059 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756519255430063461?= X-GMAIL-MSGID: =?utf-8?q?1756519255430063461?= |
Series |
pSeries dynamic secure boot secvar interface + platform keyring loading
|
|
Commit Message
Andrew Donnellan
Jan. 31, 2023, 6:39 a.m. UTC
From: Russell Currey <ruscur@russell.cc> The secvar format string and object size sysfs files are both ASCII text, and should use sysfs_emit(). No functional change. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com> --- v2: New patch (gregkh) --- arch/powerpc/kernel/secvar-sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On 1/31/23 01:39, Andrew Donnellan wrote: > From: Russell Currey <ruscur@russell.cc> > > The secvar format string and object size sysfs files are both ASCII > text, and should use sysfs_emit(). No functional change. > > Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Signed-off-by: Russell Currey <ruscur@russell.cc> > Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com> > > --- > > v2: New patch (gregkh) > --- > arch/powerpc/kernel/secvar-sysfs.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/kernel/secvar-sysfs.c b/arch/powerpc/kernel/secvar-sysfs.c > index 702044edf14d..b786d1005027 100644 > --- a/arch/powerpc/kernel/secvar-sysfs.c > +++ b/arch/powerpc/kernel/secvar-sysfs.c > @@ -35,7 +35,7 @@ static ssize_t format_show(struct kobject *kobj, struct kobj_attribute *attr, > if (rc) > goto out; > > - rc = sprintf(buf, "%s\n", format); > + rc = sysfs_emit(buf, "%s\n", format); > > out: > of_node_put(node); > @@ -57,7 +57,7 @@ static ssize_t size_show(struct kobject *kobj, struct kobj_attribute *attr, > return rc; > } > > - return sprintf(buf, "%llu\n", dsize); > + return sysfs_emit(buf, "%llu\n", dsize); > } > > static ssize_t data_read(struct file *filep, struct kobject *kobj, Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
diff --git a/arch/powerpc/kernel/secvar-sysfs.c b/arch/powerpc/kernel/secvar-sysfs.c index 702044edf14d..b786d1005027 100644 --- a/arch/powerpc/kernel/secvar-sysfs.c +++ b/arch/powerpc/kernel/secvar-sysfs.c @@ -35,7 +35,7 @@ static ssize_t format_show(struct kobject *kobj, struct kobj_attribute *attr, if (rc) goto out; - rc = sprintf(buf, "%s\n", format); + rc = sysfs_emit(buf, "%s\n", format); out: of_node_put(node); @@ -57,7 +57,7 @@ static ssize_t size_show(struct kobject *kobj, struct kobj_attribute *attr, return rc; } - return sprintf(buf, "%llu\n", dsize); + return sysfs_emit(buf, "%llu\n", dsize); } static ssize_t data_read(struct file *filep, struct kobject *kobj,