From patchwork Thu Jul 13 07:24:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hanyu001@208suo.com X-Patchwork-Id: 703131 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2891CEB64DD for ; Thu, 13 Jul 2023 07:26:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234301AbjGMH0A (ORCPT ); Thu, 13 Jul 2023 03:26:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233952AbjGMHZw (ORCPT ); Thu, 13 Jul 2023 03:25:52 -0400 Received: from mail.208.org (unknown [183.242.55.162]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F01026A2 for ; Thu, 13 Jul 2023 00:25:29 -0700 (PDT) Received: from mail.208.org (email.208.org [127.0.0.1]) by mail.208.org (Postfix) with ESMTP id 4R1mMV4RSLzBS5pl for ; Thu, 13 Jul 2023 15:24:38 +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=1689233078; x=1691825079; bh=wYJldeuL08DmlYf8zZlrQMIdz9B pS1/I/O4xkGnJ224=; b=r7d/c3byIBFbruhDj7IP9juV7pXkCSjVht/NPG9iutZ V1s7JS4QGQ0DrMgI3+el4b82skG90autuEZjYpEEUbnHaD3aJPkf3Scy0Yd1HoNi 3L6tjATLq/PRX79yKP1mkLX1szkiVTZlo3gFihquUVVrx8pmDzkHVImGUwwKmLGs vv635Yss7QEzu29rUzbKaRhShh4cXWgQXWjmVVnTmD9a5sqMhg5FnCrK4Kd3aUIy yylwbbA1VOVtmsNNGHFgouwWkYNiAr4rS3DtogjGtkXNnlPp7cyZ5/BIhkAKziIV n1CiJGvvKtGNV4KQwJKYCkrupwiBMrKsaGL2N7O2Skg== 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 hwf8PZBCaCkn for ; Thu, 13 Jul 2023 15:24:38 +0800 (CST) Received: from localhost (email.208.org [127.0.0.1]) by mail.208.org (Postfix) with ESMTPSA id 4R1mMV2hZ2zBRRM0; Thu, 13 Jul 2023 15:24:38 +0800 (CST) MIME-Version: 1.0 Date: Thu, 13 Jul 2023 15:24:38 +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: convert sysfs snprintf to sysfs_emit In-Reply-To: References: User-Agent: Roundcube Webmail Message-ID: <30394ceb9ab9d12b14919234f8bbe67f@208suo.com> X-Sender: hanyu001@208suo.com Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Fix the following coccincheck warning: drivers/usb/misc/usbsevseg.c:170:8-16: WARNING: use scnprintf or sprintf WARNING: use scnprintf or sprintf WARNING: use scnprintf or sprintf Signed-off-by: ztt <1549089851@qq.com> --- drivers/scsi/hptiop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) static ssize_t hptiop_show_fw_version(struct device *dev, @@ -1120,7 +1120,7 @@ static ssize_t hptiop_show_fw_version(struct device *dev, struct Scsi_Host *host = class_to_shost(dev); struct hptiop_hba *hba = (struct hptiop_hba *)host->hostdata; - return snprintf(buf, PAGE_SIZE, "%d.%d.%d.%d\n", + return scnprintf(buf, PAGE_SIZE, "%d.%d.%d.%d\n", hba->firmware_version >> 24, (hba->firmware_version >> 16) & 0xff, (hba->firmware_version >> 8) & 0xff, diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c index f5334ccbf2ca..26282aceac75 100644 --- a/drivers/scsi/hptiop.c +++ b/drivers/scsi/hptiop.c @@ -1111,7 +1111,7 @@ static int hptiop_adjust_disk_queue_depth(struct scsi_device *sdev, static ssize_t hptiop_show_version(struct device *dev, struct device_attribute *attr, char *buf) { - return snprintf(buf, PAGE_SIZE, "%s\n", driver_ver); + return scnprintf(buf, PAGE_SIZE, "%s\n", driver_ver); }