Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2307512rwb; Fri, 20 Jan 2023 00:51:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXsi2TuT0eSPXwksARYkd8Pr8p2LpSYW+4MNlJ+XnZzIBmxnGRy73dsJGRIq/rPB2voLqn+R X-Received: by 2002:a05:6a00:1d8d:b0:580:cc63:dcdc with SMTP id z13-20020a056a001d8d00b00580cc63dcdcmr14499192pfw.7.1674204665678; Fri, 20 Jan 2023 00:51:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674204665; cv=none; d=google.com; s=arc-20160816; b=mBM2+FExQUMTWjp5UV3ggi/MU9eTlxJbO93cqBo7W8Jb033JARLNlTIya99iTkPueQ pqdi1gHJ/DyC6s+14Dlp2ug7K4fAaJbWKq8PuZ7JvCNz47zAbp4VwgYRxwAq64r3u0zt h4joS0ZkhFhixnPePJ0O8Hs8VWHwzMOJ+doJ3ibHJYIQDJTEyIfq6RbERRip7ImE4Ads zviX9dyB3qC0Yd0om9xQpZQ/+sb6CNvQ8ZIdiyGBISIeERDcwP6QLr4DMPQFACEpnB5q tn7tx+Dd/4Hr388p1uvlNiMk/K+YZMXMow0tcfuXmKppBh7OVQVcY63dsjQwKR+4DdDh 6E9Q== 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=JfBITR2ZTvNGGVcMLga9xRX0KrOMIU4bb//V61PbJuU=; b=w117J3hQM+WS5e4RxEdhtQUjh+lsyRid+67gxgutCyuugDhyTUbuF4I2ye+MGtWlmh /j0GsT1LR8S9S4Fel6YYuptujb0FaE8XKyZBW2kiuExsKQBGBuMhOQCGDTpncmtXHSs6 z6myHKX4uHjoXCkluo8neipmq4gl8cUcbemnQa9jirCRsHFZU28s/FE/ooitgaiFG1HI IaxSQGQvQfpmALi8Ot9eB6vTb70/QrMdOHiJz9NXP8AweQMa4T1hFwbdLf98uOgezJCy TZodikjTECz4RkcxOAcxcVnM9zgqBtZQdKUpt5nSucFHdr2rZgiBkaAkitCIUQ3h7gz5 227g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=pM6pqwdD; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a8-20020a62bd08000000b00585de368d0asi696762pff.311.2023.01.20.00.50.59; Fri, 20 Jan 2023 00:51:05 -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=pM6pqwdD; 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 S230465AbjATHoY (ORCPT + 48 others); Fri, 20 Jan 2023 02:44:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230213AbjATHnv (ORCPT ); Fri, 20 Jan 2023 02:43:51 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA8CD819B7; Thu, 19 Jan 2023 23:43:48 -0800 (PST) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30K7erfC024241; Fri, 20 Jan 2023 07:43:39 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=JfBITR2ZTvNGGVcMLga9xRX0KrOMIU4bb//V61PbJuU=; b=pM6pqwdDKXBaF+cveZ46DEyy7FCsWmJ0uoQ16TwbDiJ4N6lu6TV1vD7aL2KQv79/oIUz 3ABLfxm7DnO1jhqVBoPp0uk/NtJ7cEnaHD7oh0RhllKb2rTMsC+nWjmLOfZGaME5Ti37 HSV1RdDMhPi9UDpjrYABy1HmOro3ABiO62X9xVuwjOWd8uv2R7IK2smwq8siEtVR1PCb A/X1lsffgzW891Di+UAVX64b3pnZNxMkoiENXsTDn/QHjjUJtTEAEfz1CLad9bkr6jRd t6iA37bcoIh5S68X/5JmbQXLDxBt7fiVjDfelGKmCoRdDU7aREZPisqAEApMW/zwDP70 Pw== Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3n7ntys3yu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jan 2023 07:43:39 +0000 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 30K3Pmvd010967; Fri, 20 Jan 2023 07:43:37 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma05fra.de.ibm.com (PPS) with ESMTPS id 3n3m16dk5y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jan 2023 07:43:37 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 30K7hYV222675836 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Jan 2023 07:43:34 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B55962004E; Fri, 20 Jan 2023 07:43:34 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 39A4D20040; Fri, 20 Jan 2023 07:43:34 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 20 Jan 2023 07:43:34 +0000 (GMT) Received: from jarvis-ozlabs-ibm-com.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (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 C0B8D605DC; Fri, 20 Jan 2023 18:43:29 +1100 (AEDT) From: Andrew Donnellan To: linuxppc-dev@lists.ozlabs.org, linux-integrity@vger.kernel.org Cc: gregkh@linuxfoundation.org, gcwilson@linux.ibm.com, linux-kernel@vger.kernel.org, nayna@linux.ibm.com, ruscur@russell.cc, zohar@linux.ibm.com, mpe@ellerman.id.au, gjoyce@linux.ibm.com, sudhakar@linux.ibm.com, bgray@linux.ibm.com, erichte@linux.ibm.com, joel@jms.id.au Subject: [PATCH v4 05/24] powerpc/secvar: Use sysfs_emit() instead of sprintf() Date: Fri, 20 Jan 2023 18:42:47 +1100 Message-Id: <20230120074306.1326298-6-ajd@linux.ibm.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120074306.1326298-1-ajd@linux.ibm.com> References: <20230120074306.1326298-1-ajd@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: vj_owl7ErgWk96jldBTosSO9UAu7hGBf X-Proofpoint-GUID: vj_owl7ErgWk96jldBTosSO9UAu7hGBf 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-20_04,2023-01-19_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 mlxscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 mlxlogscore=864 lowpriorityscore=0 phishscore=0 bulkscore=0 malwarescore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301200070 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,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 From: Russell Currey 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 Signed-off-by: Russell Currey Signed-off-by: Andrew Donnellan --- 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 001cdbcdb9d2..462cacc0ca60 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, -- 2.39.0