Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp242360rdb; Mon, 15 Jan 2024 20:54:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcVM6d7qN0kSI4SEkm6tAzhjBB+AW9jkCnn0wZe7kuJvZH9KBj0mD6hy7gYj3ZECQgQY/z X-Received: by 2002:a05:6a00:995:b0:6d8:df6f:b458 with SMTP id u21-20020a056a00099500b006d8df6fb458mr9721569pfg.17.1705380892463; Mon, 15 Jan 2024 20:54:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705380892; cv=none; d=google.com; s=arc-20160816; b=BenYhr0Wi1LRglqMwGM9P6x7jt0UqjHMTnySgKTDOGML7za3XsPgABf7ZnCjYaDCSq QNTT2OxTsMbGua7FHG1aZdWpXt/WHY6wrsIpfB5RVFZiewmaWs68yhm6jMFylwBYb9nl posNlNU83Iz62oF76sofroS79n5FBV/32oIM+xjpJMWgACPwUuYSfVGKybW86KX5FBFf zc1ReQOEqcZy7i+4IC+G1sl6QGkWxGllZkVQdFzOXH/Hct+wZiK4ZMMgNiAmNeZdbhkH R7j5w96BeVqWAHpX69pSL4n2ZWQH+vjwDYvjuw+xk6Lm8IALDU6hRnvRuXdohja/eBBa qV1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=13GxDnhJ4ahbbrLt2ZMNDQIAB71LJQGRU7OkNCambY0=; fh=S3bNyAe0cufZ222UcBCwoPWrXVWgPzFS0XQG7zbNNh0=; b=U+r8lfpIkR1bLoAglW+DI/8c4JwqmrF5Vk1rkMUk5YpgEVbTfEhiwuxP7CvjscBWYe HQG8aF9Uw1P+mm8vWwriYOr+ohQVClML+xwPYO/ab05Yma7J1vbCakmYWeO1du2j4Xep gugFOb6gT5ZbUEXw9AQuhi5iV+Zl75pB5m89+o8QdrVlXjvMI1JVne9jYdPys+xIk+l2 7ZK35/55fTYXL4l53zxTqp303F+AlV8cvOsave6s+85n4REGzC0YslgQPRWKIHPEDpAx UvwXzm2JmvcOvdbFEWAO8+7XZyqBTK3HsAkNSi6kakm4nUwtbCmkAPOt+9xV95Qf8rnf NZBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26970-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26970-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id bx40-20020a056a02052800b005cf0abea01dsi11534380pgb.114.2024.01.15.20.54.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 20:54:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26970-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26970-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26970-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 22852284BF3 for ; Tue, 16 Jan 2024 04:54:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 64D93134D5; Tue, 16 Jan 2024 04:52:30 +0000 (UTC) Received: from esa9.hc1455-7.c3s2.iphmx.com (esa9.hc1455-7.c3s2.iphmx.com [139.138.36.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 760B512B9F; Tue, 16 Jan 2024 04:52:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fujitsu.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fujitsu.com X-IronPort-AV: E=McAfee;i="6600,9927,10954"; a="134631007" X-IronPort-AV: E=Sophos;i="6.04,198,1695654000"; d="scan'208";a="134631007" Received: from unknown (HELO oym-r1.gw.nic.fujitsu.com) ([210.162.30.89]) by esa9.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2024 13:52:24 +0900 Received: from oym-m3.gw.nic.fujitsu.com (oym-nat-oym-m3.gw.nic.fujitsu.com [192.168.87.60]) by oym-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id 5CC72E7520; Tue, 16 Jan 2024 13:52:22 +0900 (JST) Received: from kws-ab4.gw.nic.fujitsu.com (kws-ab4.gw.nic.fujitsu.com [192.51.206.22]) by oym-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id 8442ED948C; Tue, 16 Jan 2024 13:52:21 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab4.gw.nic.fujitsu.com (Postfix) with ESMTP id 27BAD6B4CA; Tue, 16 Jan 2024 13:52:21 +0900 (JST) Received: from localhost.localdomain (unknown [10.167.226.45]) by edo.cn.fujitsu.com (Postfix) with ESMTP id B22941A0160; Tue, 16 Jan 2024 12:52:20 +0800 (CST) From: Li Zhijian To: linux-kernel@vger.kernel.org Cc: Li Zhijian , HighPoint Linux Team , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: [PATCH 24/42] drivers/scsi/hptiop: Convert snprintf to sysfs_emit Date: Tue, 16 Jan 2024 12:51:33 +0800 Message-Id: <20240116045151.3940401-22-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240116045151.3940401-1-lizhijian@fujitsu.com> References: <20240116041129.3937800-1-lizhijian@fujitsu.com> <20240116045151.3940401-1-lizhijian@fujitsu.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1417-9.0.0.1002-28122.005 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-28122.005 X-TMASE-Result: 10--11.907000-10.000000 X-TMASE-MatchedRID: /HyfiRbsgEU4ibokZ3+Q0CoiRKlBVkYIBXngI6jFvpfvd49YGReckE1N J2MN+nPkgxCMf8A0YpR5sRK06wHV4WJleE90a8+1LdBFrfY9r2n0swHSFcVJ6MC5DTEMxpeQfiq 1gj2xET8vYRhsicUjm01kA/urPNIDxG11D4HJ3wQZgmFGHqyx645UafLmrvaGqU5CNByvM6VJXG E2pW97R+LzNWBegCW2wgn7iDBesS0gBwKKRHe+r3Rrqf0GOj13/eUbqiR8ae1kOm2nW3AY4MT4g PlvnxGOV6KEs3hne9Y= X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 Per filesystems/sysfs.rst, show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. coccinelle complains that there are still a couple of functions that use snprintf(). Convert them to sysfs_emit(). > ./drivers/scsi/hptiop.c:1114:8-16: WARNING: please use sysfs_emit > ./drivers/scsi/hptiop.c:1123:8-16: WARNING: please use sysfs_emit No functional change intended CC: HighPoint Linux Team CC: "James E.J. Bottomley" CC: "Martin K. Petersen" CC: linux-scsi@vger.kernel.org Signed-off-by: Li Zhijian --- drivers/scsi/hptiop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c index f5334ccbf2ca..65426df93270 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 sysfs_emit(buf, "%s\n", driver_ver); } 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 sysfs_emit(buf, "%d.%d.%d.%d\n", hba->firmware_version >> 24, (hba->firmware_version >> 16) & 0xff, (hba->firmware_version >> 8) & 0xff, -- 2.29.2