Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1170022pxb; Thu, 4 Mar 2021 05:17:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSL+cxyOd1k12330pFxdnpRS7e0l5KP3/UP+qlIQUkep51Fc2u+R1OPnfEKrZDe/0N/AlP X-Received: by 2002:a17:906:544b:: with SMTP id d11mr4301022ejp.167.1614863822175; Thu, 04 Mar 2021 05:17:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614863822; cv=none; d=google.com; s=arc-20160816; b=YqWnF2r0TLYFCnaNkgi1wLvpeUePqiUEkC9aYFffZDY4DUlZnf2cK2klLRbH8zPdLS 6qTRBnT7n6Mb0Qbyo/7zhYYEytzAc6xVRuwaFSQ4VYV6c8dQ8FgjpN+XRlyOteIoZC5C /1OLGJ69TS12nvx5R2AukD2TZG6KH6HPUVwwNrTeANIR7ghbcg18L5av4tEj5mbMS10k 8sYB3WGuea6LHre6vDrVO7u2p3cAXq/oU7QcC2gwGsUasztcZkc1ypbV7fqlPQNOymo3 WnaCHii/HYP2p/I3KvsJ6zknezZSL3oJOy6eiV5z651uU8qrT7wM1SaeIQ8qlu4X589b twKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:dmarc-filter :sender:dkim-signature; bh=oHL2QLuF0yTmY0Us4bq25wLVQqk2jf6gVgZs2Pe951s=; b=ZH1uZlrhYn8M0N+1IQnBXNLqlbfNh4M6glVxWumpOi7blOLIU3TfzA2JA5ilVbR8Za flAPipUIcUP3c1ftmpH8Ln+tUQ19Yuz3qw7JQlkbaffpU7UrvuGKGrCgdlK8zhtdiPTE zj4Ies+wzzNT8jD+85PD+t0S3NZh0//TpFaX1J17Sk9q98+iHMyQTfdFhc3EO+8E+X2C urOVH+MkhtXxO/Lyyos+U6EWNPATc+eHngMZ4RZVSjGxOypq+lP79JXZ6nRf6oLQ7edG YOw4IciTUCHnY66tHfABCzTBLbMlzKNAZRhSqifnBnrlWBni5gh0877C5vDpCqcP3x0V joJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=wlCEVhPA; 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 w14si17659454ede.222.2021.03.04.05.16.38; Thu, 04 Mar 2021 05:17:02 -0800 (PST) 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=@mg.codeaurora.org header.s=smtp header.b=wlCEVhPA; 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 S1354246AbhCDAHt (ORCPT + 99 others); Wed, 3 Mar 2021 19:07:49 -0500 Received: from m42-2.mailgun.net ([69.72.42.2]:39843 "EHLO m42-2.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1389846AbhCCVsI (ORCPT ); Wed, 3 Mar 2021 16:48:08 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1614808057; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=oHL2QLuF0yTmY0Us4bq25wLVQqk2jf6gVgZs2Pe951s=; b=wlCEVhPAIcYwebmkIxkV/IigL/GCidYGpEmhShei5ZfYpZxFb5ooHUi+rHUlLnnsAEYriyIj VLNNh0Z1bZLBIsKFTN+Ka2JLNa5pCQ0NvOsc+BxFmqHyX9YELP8coqKnlOfiWFCiM0xaPh0j sRtK0R0D+WF3fUsCnWl/H6zd2+s= X-Mailgun-Sending-Ip: 69.72.42.2 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-east-1.postgun.com with SMTP id 604003df7b648e24363cfac4 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 03 Mar 2021 21:47:11 GMT Sender: sidgup=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id AED14C433C6; Wed, 3 Mar 2021 21:47:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from sidgup-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sidgup) by smtp.codeaurora.org (Postfix) with ESMTPSA id AB3FBC433CA; Wed, 3 Mar 2021 21:47:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org AB3FBC433CA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=sidgup@codeaurora.org From: Siddharth Gupta To: ohad@wizery.com, bjorn.andersson@linaro.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Raghavendra Rao Ananta , Siddharth Gupta Subject: [PATCH v2] remoteproc: sysfs: Use sysfs_emit instead of sprintf Date: Wed, 3 Mar 2021 13:47:02 -0800 Message-Id: <1614808022-26062-1-git-send-email-sidgup@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Raghavendra Rao Ananta For security reasons sysfs_emit() is preferred over sprintf(). Hence, convert the remoteproc's sysfs show functions accordingly. Signed-off-by: Raghavendra Rao Ananta Signed-off-by: Siddharth Gupta --- drivers/remoteproc/remoteproc_sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/remoteproc_sysfs.c b/drivers/remoteproc/remoteproc_sysfs.c index 1dbef89..6840dad 100644 --- a/drivers/remoteproc/remoteproc_sysfs.c +++ b/drivers/remoteproc/remoteproc_sysfs.c @@ -15,7 +15,7 @@ static ssize_t recovery_show(struct device *dev, { struct rproc *rproc = to_rproc(dev); - return sprintf(buf, "%s", rproc->recovery_disabled ? "disabled\n" : "enabled\n"); + return sysfs_emit(buf, "%s", rproc->recovery_disabled ? "disabled\n" : "enabled\n"); } /* @@ -82,7 +82,7 @@ static ssize_t coredump_show(struct device *dev, { struct rproc *rproc = to_rproc(dev); - return sprintf(buf, "%s\n", rproc_coredump_str[rproc->dump_conf]); + return sysfs_emit(buf, "%s\n", rproc_coredump_str[rproc->dump_conf]); } /* -- Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project