Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8597468rwp; Wed, 19 Jul 2023 12:12:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlFTE474KXp3MNJ3mc9iPrASuPKOjr+WVFZimgEq5Oz2mECfZZ+v+TFe8BLnvrAWUVbt6MAN X-Received: by 2002:a05:6a00:1798:b0:67f:830f:b809 with SMTP id s24-20020a056a00179800b0067f830fb809mr4401826pfg.3.1689793957329; Wed, 19 Jul 2023 12:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689793957; cv=none; d=google.com; s=arc-20160816; b=EijWaAtxPOwhhrf+QfNfWgbhx+Cv1gu8JvY1+NwMsQG+uDbeD6JIvlIv1EL0jpAB6V Gt3BhPN7iWnUH1AFORZIAuV9d1gBghRUYzyQpoxQdFqAudWx8xRBeg7qOZ42ssLwflbg ucnLBzmGIILpkMEjtN7SD9fEHCsmQ1XI1Gl7EFAkK7KNvi6IGnjIhKfyW9QEp+qPfrfx qfPB6SAj/acr3dEneg7wgDizfue/y58HXakbZi/7xRMDxHL3CGkxkGD9jOmMhkG3VuZq RwgPUjij01fZolOszBZVP7klf/0kCDOIsYrRHgzXLnZevqW8kEPMPyKTCigsYukaoZKR OdoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7Y/GUFxEIaTqE74eL24zjniGM/m0YHfzJ+3Frv5JlMY=; fh=4YaNAvCBi3ertd+cT3V8eytkOY49xpSu0EU/4Ag6mYo=; b=cjHN7YOgSrQ3fuB/Z77fgMzm5nufL4Ofr6t9iQ5vY3xv5OjltMTw5th1VxIOX+ddoS XxeZwpNbm/ZotLaeP76/7q4UbvhtZ4paAg3EC5PpoxxLcf8p6PT1DScNxjdNVpljXni8 Iq7ua6kxaX09I6uCdrekIV63c4MkmF8suPM3K2mInDYm1X1hsZLIMd3lDeA4ipVI7JUE VdbseMmbtNSWOeiJ8X/KPTjmry1Dg5ChJiuxtc/fqx/ebrNku3yOU1jLkjMu7fOj2eUI ad59067nE2PjIrF0S1lSgB+dI4d2i5Ogqd4purDGHtLLdLiaXsLL6J7OtgY4b6FBiLUM PCOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TUjFXIVv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s75-20020a63774e000000b0053074c54c3fsi1429225pgc.868.2023.07.19.12.12.24; Wed, 19 Jul 2023 12:12:37 -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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TUjFXIVv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230053AbjGSSI7 (ORCPT + 99 others); Wed, 19 Jul 2023 14:08:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjGSSI6 (ORCPT ); Wed, 19 Jul 2023 14:08:58 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 052659E for ; Wed, 19 Jul 2023 11:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689790096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7Y/GUFxEIaTqE74eL24zjniGM/m0YHfzJ+3Frv5JlMY=; b=TUjFXIVv237A+vGoomvKE3FN+oeQyMovsBgfgxn+gX+wVkcAvC5qUwfsuTlcTxbL6gFWqd pfjNNT2I+4mwg/XO4PW8UmAiElSGKtkP1i0Xq8zJkRjcqlwIDPWJUCyot6EEJbwT+hCFaL LcziYxSxgvDx1p1QSfwLwL1hqcrjazk= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-578-HYUpaIqROryscYW4dmy5og-1; Wed, 19 Jul 2023 14:08:14 -0400 X-MC-Unique: HYUpaIqROryscYW4dmy5og-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 29CB43C108DD; Wed, 19 Jul 2023 18:08:14 +0000 (UTC) Received: from rhel-developer-toolbox-latest (unknown [10.2.16.238]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 960E61121314; Wed, 19 Jul 2023 18:08:13 +0000 (UTC) Date: Wed, 19 Jul 2023 11:08:11 -0700 From: Chris Leech To: hanyu001@208suo.com Cc: jejb@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Fwd: [PATCH] scsi: be2iscsi: wacom: convert sysfs sprintf/snprintf family to sysfs_emit Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Fri, Jul 14, 2023 at 04:10:43PM +0800, hanyu001@208suo.com wrote: > 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> These should all be converted to sysfs_emit instead of scnprintf. Thanks, - Chris Leech > --- > 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); > }