Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2181454rwp; Fri, 14 Jul 2023 02:00:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlFYWoWm+JEPyxM3LNDz48sB98NiFNPm0R8a6iGCrd2sYaiXn9qoSC463TWSznc89gqzauP8 X-Received: by 2002:a05:6358:9184:b0:134:c37f:4b64 with SMTP id j4-20020a056358918400b00134c37f4b64mr5278479rwa.30.1689325203223; Fri, 14 Jul 2023 02:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689325203; cv=none; d=google.com; s=arc-20160816; b=wDa3CZu+60nRDSVUUzRdX0EyOX7bfRFztE/3h8aVo6ll7drsvmvwTOqixiaR+nF1GQ n809rBnVAfDWDgHQnpAZZnbuZ/1ELkXgolRI2ipRIzCL6Oj6qC3jY59kX44rm1I0miNs S8OsUKlFXHzI0iReoC4iBUlyfPBDYWuMfDM1Zf4TN3wiKa43UzS3hpPvWH/+B/UoYP95 A4cYz7m6FbeT224iQcr8SG32wyUf0TXoAUkHHgAS03IS9E1gDXsBBThMALk46SKUZ8GQ qFmKzGhkzaZuT6lfvnX0CHZmhBThaDEI7NLFG9LfYxZZra81zXN1ut+wxAJPGJYFKisU ZpHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version :dkim-signature; bh=jLLAvqp8HukX3tCCe5WX0IogrepPkMKs/LJz7EjmyT8=; fh=FZY8AuhUF14GAl4i51HNyKXYHQK9aDnwBeZ+jzJSxD8=; b=FiFx9rbOKUf+1Lt+i95G+l5I7j9xIw5/z9CDW1EaxLmBaLXaTsm8vMVp4DTaITVRjA XnvPFefWejgfldSO8CllR4p726YpzQA1L1s5hrpoZ+gEKLwpQN49eMwaQtIvjkHiiNZC ldv73toznyXYMMG1P2t8u0wpLr5LEWdupWg5zIabzyVFvSruslRl35XXl9ikMjzqk9bl g/rVOOWCeoLnwVc6xpKZKUiHs50c1ysdXGG4MNR7FsFJ92eO9R0Bucx81ZkHUuEGzJlL DD+9eef1lLS/sxYtaoSmut3qgtn5RJu+S+/jmUato4vqp5g7AvG7dA1v87y7JBGbGDoP QEug== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (bad version) header.i=@208.org header.s=dkim header.b=ke5oI5HF; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ch4-20020a056a00288400b00681c3725a98si458954pfb.82.2023.07.14.01.59.49; Fri, 14 Jul 2023 02:00:03 -0700 (PDT) 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=neutral (bad version) header.i=@208.org header.s=dkim header.b=ke5oI5HF; 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 S235122AbjGNIVf (ORCPT + 99 others); Fri, 14 Jul 2023 04:21:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235028AbjGNIVd (ORCPT ); Fri, 14 Jul 2023 04:21:33 -0400 Received: from mail.208.org (unknown [183.242.55.162]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1C62134 for ; Fri, 14 Jul 2023 01:21:31 -0700 (PDT) Received: from mail.208.org (email.208.org [127.0.0.1]) by mail.208.org (Postfix) with ESMTP id 4R2PLD2GM4zBR9sj for ; Fri, 14 Jul 2023 16:10:44 +0800 (CST) Authentication-Results: mail.208.org (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=208.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=208.org; h= content-transfer-encoding:content-type:message-id:user-agent :references:in-reply-to:subject:to:from:date:mime-version; s= dkim; t=1689322244; x=1691914245; bh=hi2JCXpuWCGnO3LedqdVgh9QV7J Qv/56InerFXZUi1A=; b=ke5oI5HFDNgABUfbDVVgWGOlDL0tSk2hQxlS+KgL1ex vjiJVU3ZmQUgFRCmTgsC7tdzEo5DlXUW4Ynl4aQiKT0Yfyf40SnXtuRotp9UdDEK ub2G7TOWWAJjbe94lZfNOF9Gc2vOiEnZaMoUhxj6M8wIjIbOmKNpwUnXUspK8jNN 23v1bbgafhHnkXI85gvPNyE9izI9GFhB9HvAq60OXgZA5uvO94zdvI0P/ijTcNYa xSj91mMgWXrHYWOJ6ljqCBZ9VUxJmlxasWjWWwZlrP3x0g3qAjgZJi8SUSXaTrpo H6MT9uLpG7pdGKq3evCqCtomDwoLOI0M8mZc/VxVRfg== X-Virus-Scanned: amavisd-new at mail.208.org Received: from mail.208.org ([127.0.0.1]) by mail.208.org (mail.208.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id D9g_QrEBbjdh for ; Fri, 14 Jul 2023 16:10:44 +0800 (CST) Received: from localhost (email.208.org [127.0.0.1]) by mail.208.org (Postfix) with ESMTPSA id 4R2PLD0RjgzBR9sc; Fri, 14 Jul 2023 16:10:44 +0800 (CST) MIME-Version: 1.0 Date: Fri, 14 Jul 2023 16:10:43 +0800 From: hanyu001@208suo.com To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Fwd: [PATCH] scsi: be2iscsi: wacom: convert sysfs sprintf/snprintf family to sysfs_emit In-Reply-To: References: User-Agent: Roundcube Webmail Message-ID: X-Sender: hanyu001@208suo.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RDNS_NONE,SPF_HELO_FAIL,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no 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 Fix the following coccicheck warning: ./drivers/hid/wacom_sys.c:1828:8-16: WARNING: use scnprintf or sprintf. ./drivers/scsi/be2iscsi/be_mgmt.c:1251:9-17: WARNING: use scnprintf or sprintf ./drivers/scsi/be2iscsi/be_mgmt.c:1145:8-16: WARNING: use scnprintf or sprintf ./drivers/scsi/be2iscsi/be_mgmt.c:1164:8-16: WARNING: use scnprintf or sprintf ./drivers/scsi/be2iscsi/be_mgmt.c:1280:8-16: WARNING: use scnprintf or sprintf Signed-off-by: ztt <1549089851@qq.com> --- drivers/scsi/be2iscsi/be_mgmt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c index 4e899ec1477d..4916ce9c36a6 100644 --- a/drivers/scsi/be2iscsi/be_mgmt.c +++ b/drivers/scsi/be2iscsi/be_mgmt.c @@ -1142,7 +1142,7 @@ ssize_t beiscsi_drvr_ver_disp(struct device *dev, struct device_attribute *attr, char *buf) { - return snprintf(buf, PAGE_SIZE, BE_NAME "\n"); + return scnprintf(buf, PAGE_SIZE, BE_NAME "\n"); } /** @@ -1161,7 +1161,7 @@ beiscsi_fw_ver_disp(struct device *dev, struct device_attribute *attr, struct Scsi_Host *shost = class_to_shost(dev); struct beiscsi_hba *phba = iscsi_host_priv(shost); - return snprintf(buf, PAGE_SIZE, "%s\n", phba->fw_ver_str); + return scnprintf(buf, PAGE_SIZE, "%s\n", phba->fw_ver_str); } /** @@ -1248,7 +1248,7 @@ beiscsi_adap_family_disp(struct device *dev, struct device_attribute *attr, case BE_DEVICE_ID1: case OC_DEVICE_ID1: case OC_DEVICE_ID2: - return snprintf(buf, PAGE_SIZE, + return scnprintf(buf, PAGE_SIZE, "Obsolete/Unsupported BE2 Adapter Family\n"); case BE_DEVICE_ID2: case OC_DEVICE_ID3: @@ -1277,7 +1277,7 @@ beiscsi_phys_port_disp(struct device *dev, struct device_attribute *attr, struct Scsi_Host *shost = class_to_shost(dev); struct beiscsi_hba *phba = iscsi_host_priv(shost); - return snprintf(buf, PAGE_SIZE, "Port Identifier : %u\n", + return scnprintf(buf, PAGE_SIZE, "Port Identifier : %u\n", phba->fw_config.phys_port); }