From patchwork Sun Nov 27 12:49:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KaiLong Wang X-Patchwork-Id: 26349 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5097541wrr; Sun, 27 Nov 2022 04:52:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ovDxuMBpxT2SrOqZ+Lpow63rCyeUCFBFmE+jBDR3ak6zloJYoa0QBUmhfqQ6ghqRG4m29 X-Received: by 2002:a17:90a:ae0f:b0:20d:b124:33b1 with SMTP id t15-20020a17090aae0f00b0020db12433b1mr48462193pjq.202.1669553520822; Sun, 27 Nov 2022 04:52:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669553520; cv=none; d=google.com; s=arc-20160816; b=fGstcFQAOetqwysFFKaXfaOyy2Qmq4XK/SyLYAc705I+P2uGH0gpu/MU1Y/sSrfFci F4i61qzkRtvoz4ZStgPpC+obmniDufqBqq4TWJ6nT70fFKRAlEjyUGQh14hTr+fgPo6P E+9vDEjYWheSoCesSIC3l+azZLyl5RUCBMBD/vJ3LZhO8uY1P+S0Ji+Bp8k5yRi9Vmcz PfTQ3ur7mFYjHqgVsBSIP88W8NKAs/6nPpzXWaCtSF2kak+1ow3hzY2PzO4Cmnrn0nLY IPUNcj57MhRZqTlTAKXyNoyvt8TW/alTFLjOjzq1QTwpYEj1gCRW6En4l9Q/4shL6H+I MXLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:mime-version :content-transfer-encoding:subject:cc:to:from:date; bh=KaJpnysotGovuaYZ9svY3/AV0urikY9m+GYHr9xw4mU=; b=j7YnZkeXtKtKBeaXIFycTw6ufWqD4CeDuwQeaFo9mCyTLeg/G8PP8XtSUPCrGAUqYN J7/MTTBhbvc07gjrAY03R+Nj2dFSMfiJDs/oZQ9AmpGyKjgLMLlv2l6SjMNUueooyejv Kt5dY3nPplRUuxzE61sN1EcUAIPra8Cjw++URXAg7c/n47xjCH4BI7pnvUbzjh9aOMhe GE64DKssLj9K96DDl/YRyFleI9FocWDfXHsj26fJRfDndc2lpxPUsH4Gcu+61xDc111A hmOe7xNVhJfkEEZN1sNtmL1z4vIpcS4SSUt6VpiV5+1FQaJ8W/ghR+DCaZ8mHxA69KrB r5Xw== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q9-20020a170902bd8900b00189850a8ad8si1143083pls.577.2022.11.27.04.51.42; Sun, 27 Nov 2022 04:52:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229622AbiK0Mt1 (ORCPT + 99 others); Sun, 27 Nov 2022 07:49:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbiK0MtZ (ORCPT ); Sun, 27 Nov 2022 07:49:25 -0500 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 410B86562; Sun, 27 Nov 2022 04:49:24 -0800 (PST) Received: by ajax-webmail-localhost.localdomain (Coremail) ; Sun, 27 Nov 2022 20:49:16 +0800 (GMT+08:00) X-Originating-IP: [182.148.15.36] Date: Sun, 27 Nov 2022 20:49:16 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: "KaiLong Wang" To: jikos@kernel.org, benjamin.tissoires@redhat.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] HID: sony: convert sysfs snprintf to sysfs_emit X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT6.0.1 build 20210329(c53f3fee) Copyright (c) 2002-2022 www.mailtech.cn mispb-4e503810-ca60-4ec8-a188-7102c18937cf-zhkzyfz.cn MIME-Version: 1.0 Message-ID: <7f3fb8ac.1d4.184b9227e20.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwCnu+HMXINjanIFAA--.132W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQADB2FEYx0G1gAEsK X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00,RCVD_IN_PBL,RDNS_NONE, T_SPF_HELO_PERMERROR,T_SPF_PERMERROR,XPRIO autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** 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?1750653752596513900?= X-GMAIL-MSGID: =?utf-8?q?1750653752596513900?= Fix the following coccicheck warning: drivers/hid/hid-sony.c:710:8-16: WARNING: use scnprintf or sprintf drivers/hid/hid-sony.c:747:8-16: WARNING: use scnprintf or sprintf drivers/hid/hid-sony.c:759:8-16: WARNING: use scnprintf or sprintf Signed-off-by: KaiLong Wang --- drivers/hid/hid-sony.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 03691cdcfb8e..5925ed6152f5 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -707,7 +707,7 @@ static ssize_t ds4_show_poll_interval(struct device *dev, struct hid_device *hdev = to_hid_device(dev); struct sony_sc *sc = hid_get_drvdata(hdev); - return snprintf(buf, PAGE_SIZE, "%i\n", sc->ds4_bt_poll_interval); + return sysfs_emit(buf, "%i\n", sc->ds4_bt_poll_interval); } static ssize_t ds4_store_poll_interval(struct device *dev, @@ -744,7 +744,7 @@ static ssize_t sony_show_firmware_version(struct device *dev, struct hid_device *hdev = to_hid_device(dev); struct sony_sc *sc = hid_get_drvdata(hdev); - return snprintf(buf, PAGE_SIZE, "0x%04x\n", sc->fw_version); + return sysfs_emit(buf, "0x%04x\n", sc->fw_version); } static DEVICE_ATTR(firmware_version, 0444, sony_show_firmware_version, NULL); @@ -756,7 +756,7 @@ static ssize_t sony_show_hardware_version(struct device *dev, struct hid_device *hdev = to_hid_device(dev); struct sony_sc *sc = hid_get_drvdata(hdev); - return snprintf(buf, PAGE_SIZE, "0x%04x\n", sc->hw_version); + return sysfs_emit(buf, "0x%04x\n", sc->hw_version); } static DEVICE_ATTR(hardware_version, 0444, sony_show_hardware_version, NULL);