Received: by 2002:ab2:5c0e:0:b0:1ef:a325:1205 with SMTP id i14csp175987lqk; Wed, 13 Mar 2024 22:28:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWDt3tP78JjqyxG29OlaodbhQbGOJjtyQx+KyxNmL57WP/J4J1+4/vQT3VxTMquLgZUwbCe2qpAjt5zGYbhzLXzw55VGCuqxSqTxbUbkw== X-Google-Smtp-Source: AGHT+IG8o/c5LIBz8iNrZ8V3VWviMxqHEWX/P3EqG3uRkE4aCUhTuAemGQPaLnk0PejlV33g9tl6 X-Received: by 2002:a05:6402:3908:b0:568:9700:eda0 with SMTP id fe8-20020a056402390800b005689700eda0mr281376edb.37.1710394134764; Wed, 13 Mar 2024 22:28:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710394134; cv=pass; d=google.com; s=arc-20160816; b=t4WT2sdBf4QuebtNSmXgYmAdLhyvbc+q5eg2Zb+UFz/DkCsrdeeZQoS0yfroWhRRd/ aVhXEXytKoxDlkroAcMZGT110I2/gaSyqURDxRHtuvaNAjTD+1xf+x5h9XEL6F+C0CJP tql4j9qzSbxn7l+N4PAkcLw5H+Zh5xMKetFho+npjbXQJAJNBiH3M0NVAXUT13rl36Qa 8ldoUAY3Qemk+sZBCWqPu4VhZxQX/gxGCxsTy+mpXRNiY4Swsv9ZHdofXA7BBV4gZ+0T qP1mKqvd9wkkCNB2FoHiIgfLZjz1t/imjE5LpfQ1Byyb5yY3CXH1LIC+3znJMfCpolrY uZhQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=DOjZ6Fmr5NAfSIUIhuSVobblg8C1F6iydtjpcIkCczI=; fh=UvoawC3fI5fMP9+gwgr5aisFWSHoykCl21+wlPgFuxg=; b=AWLG5tf54JUi73Z6fS1la1I7yPL68SxOFwoHoHio5ZkrR0plR0R9TzDkvYCDYjICBb pooqT/55KFc0zqySKE5Cym0bKLM5DNzshfHndb8edx79VQkJ/HmXFh6jQH3WP9dja1CE P7N+GsctqwmBCIBye4QMAek+gCaoyfgzx2J8YP3nGFmNwLjWWcsFL1PgiNW6Gb6XsFYF DxaCYIl7yq9rt4UTz3x6pW7M05OoXlf03/iWgD+BNp5bcBDym1qnOC2pmVR0MclPZOz4 wwIJrq5ZOcFbaDLX1AYgfXdjE+VQuul0iUF0ptIJFAgm0hQaSAWWQhVJKaqvlvEp2owe 1Dlg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-102787-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102787-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z20-20020a05640235d400b00566a43cffecsi387339edc.40.2024.03.13.22.28.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 22:28:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102787-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-102787-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102787-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7C97B1F22D71 for ; Thu, 14 Mar 2024 05:28:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7686D946F; Thu, 14 Mar 2024 05:28:47 +0000 (UTC) Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9F998F55 for ; Thu, 14 Mar 2024 05:28:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710394127; cv=none; b=jVOz8To+pSySzxjqyxsRYny13SAuORLN2mM2KRO+eQYyQYShuV5Fkkh9WTXVSyI7S64mx2xt5gQcVTca/fAozQPI/9nD7+EG31Au/TN/UjKLnD7OsEP80COdPgo0hKvtbTEy8Fv+hGAPlKYuTF7VJfzmUHL9W+6iw8yFa4YilTY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710394127; c=relaxed/simple; bh=/AefSDURd/iYE924k0hdYlGbe6MFO75hbbd6fJusvVE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=SNJ3Ai3Dd2dNrfQ0fPfxujWh1FGQ53Iz1b4HgiRPBkBaQkDV1AVT4NznsR/NAB1v5Mqi60YlGJJehkf5YPYG/nTu0yKv7N807SYaZN9aDF5MEU5zn8OpIQZico7fveluDtotcDq8voxdTv+5QGn3w2CgPRrfYPj2kNX+SIeKBOE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: dbd5edc51dde46b88f366b7d46b59894-20240314 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:524a0ae8-916c-4a51-bac7-58c2790c9869,IP:10, URL:0,TC:0,Content:0,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACT ION:release,TS:20 X-CID-INFO: VERSION:1.1.37,REQID:524a0ae8-916c-4a51-bac7-58c2790c9869,IP:10,UR L:0,TC:0,Content:0,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:20 X-CID-META: VersionHash:6f543d0,CLOUDID:a31b7c81-4f93-4875-95e7-8c66ea833d57,B ulkID:2403141328344WTIQMFJ,BulkQuantity:0,Recheck:0,SF:24|17|19|44|66|38|1 02,TC:nil,Content:0,EDM:5,IP:-2,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC: nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: dbd5edc51dde46b88f366b7d46b59894-20240314 X-User: aichao@kylinos.cn Received: from localhost.localdomain [(112.64.161.44)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 792691737; Thu, 14 Mar 2024 13:28:30 +0800 From: Ai Chao To: bleung@chromium.org, tzungbi@kernel.org, chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Ai Chao Subject: [PATCH v1] platform/chrome: use sysfs_emit() instead of sprintf() Date: Thu, 14 Mar 2024 13:28:28 +0800 Message-Id: <20240314052828.186924-1-aichao@kylinos.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Follow the advice in Documentation/filesystems/sysfs.rst: show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Ai Chao --- drivers/platform/chrome/wilco_ec/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/chrome/wilco_ec/sysfs.c b/drivers/platform/chrome/wilco_ec/sysfs.c index 893c59dde32a..d44c43559621 100644 --- a/drivers/platform/chrome/wilco_ec/sysfs.c +++ b/drivers/platform/chrome/wilco_ec/sysfs.c @@ -192,7 +192,7 @@ static ssize_t usb_charge_show(struct device *dev, if (ret < 0) return ret; - return sprintf(buf, "%d\n", rs.val); + return sysfs_emit(buf, "%d\n", rs.val); } static ssize_t usb_charge_store(struct device *dev, -- 2.25.1