Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp154323pxb; Tue, 2 Feb 2021 01:34:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnlbeQhoFhGbiXoSE/N8GSmGMzwHnt52PKBq26O/lyb+gK0D/ZMBlP0NoI9RFnOzg1EC9E X-Received: by 2002:a17:906:9401:: with SMTP id q1mr22078320ejx.516.1612258481086; Tue, 02 Feb 2021 01:34:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612258481; cv=none; d=google.com; s=arc-20160816; b=L2C0QzUXL8Pu+itBurIYFVQWnQ7yOkHTEavahYV/o6J9uSj+YsiH6CJjbTe3bSQ6Eq 0RNQVUy23YXM0goUZ3T6D3ZLBbrwYkl1npDypSO2m/35c9pWQZOmPJDFh3FkhRjd+TNG mT7jGVUmVa8B8nc/58rSSl8PdlPie0Yw6NH8B/DaUn1C0RMnTRRzNTm3leApHpUqUIMo YW3WgPacdYsXbi52+DShccyENeJ3fjfOFXLiAGj6QYZJoXYlBxfQ31DFdohRZtWfHXjn 7jp8MHrns76izA2QJ5KuWcMpD9E+VU8+CZQ87kESH7T4AnPXxI4jbOtbyroC0jRV2LEy XNtg== 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; bh=tmg7EurGPW4xNl03SSaTg+MVmOUo7lINCyK5m3xiPfs=; b=RUQSsPWfwaur0tCg27uiEOEk67CP7fvjw+jlKw31LRApIPRKkLyCw8xUIMGYWquwly aDC7AWaNafBT5wizJwoviELB2CYcb44rpy2TkIWCfOH/sqL/dPPJAuq/qZYfYETkTOR9 yPKLVEJWGbGu5mi2bcAVi9jCpJXZAxAK7CRfLL1fmTf7ScWcONgRlXj5NxkXXGXBGiUG DEfOyaHH48dzAs1BDC0ks0OLdjDj4nIrjmp+jkxUAYit7Mt7yeu8JJ3WL+MLEohUp5VY Ah6xf0Y1Td8FKX2Ew6ZyE9yX83WA3xGQ8UpyvWGfe6NrN5LqvmRYjrHvlkV2qIoj2jRP DzCw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 40si3009146edr.233.2021.02.02.01.34.17; Tue, 02 Feb 2021 01:34:41 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232971AbhBBJcg (ORCPT + 99 others); Tue, 2 Feb 2021 04:32:36 -0500 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:52931 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232766AbhBBJca (ORCPT ); Tue, 2 Feb 2021 04:32:30 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0UNfeAix_1612258263; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0UNfeAix_1612258263) by smtp.aliyun-inc.com(127.0.0.1); Tue, 02 Feb 2021 17:31:12 +0800 From: Jiapeng Chong To: erazor_de@users.sourceforge.net Cc: jikos@kernel.org, benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH] HID: displays: convert sysfs sprintf/snprintf family to sysfs_emit Date: Tue, 2 Feb 2021 17:31:01 +0800 Message-Id: <1612258261-96457-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following coccicheck warning: ./drivers/hid/hid-roccat-arvo.c:45:8-16: WARNING: use scnprintf or sprintf. ./drivers/hid/hid-roccat-arvo.c:95:8-16: WARNING: use scnprintf or sprintf. ./drivers/hid/hid-roccat-arvo.c:149:8-16: WARNING: use scnprintf or sprintf. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- drivers/hid/hid-roccat-arvo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-roccat-arvo.c b/drivers/hid/hid-roccat-arvo.c index ffcd444..4556d2a 100644 --- a/drivers/hid/hid-roccat-arvo.c +++ b/drivers/hid/hid-roccat-arvo.c @@ -42,7 +42,7 @@ static ssize_t arvo_sysfs_show_mode_key(struct device *dev, if (retval) return retval; - return snprintf(buf, PAGE_SIZE, "%d\n", temp_buf.state); + return sysfs_emit(buf, "%d\n", temp_buf.state); } static ssize_t arvo_sysfs_set_mode_key(struct device *dev, @@ -92,7 +92,7 @@ static ssize_t arvo_sysfs_show_key_mask(struct device *dev, if (retval) return retval; - return snprintf(buf, PAGE_SIZE, "%d\n", temp_buf.key_mask); + return sysfs_emit(buf, "%d\n", temp_buf.key_mask); } static ssize_t arvo_sysfs_set_key_mask(struct device *dev, @@ -146,7 +146,7 @@ static ssize_t arvo_sysfs_show_actual_profile(struct device *dev, struct arvo_device *arvo = hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); - return snprintf(buf, PAGE_SIZE, "%d\n", arvo->actual_profile); + return sysfs_emit(buf, "%d\n", arvo->actual_profile); } static ssize_t arvo_sysfs_set_actual_profile(struct device *dev, -- 1.8.3.1