Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3492227pxb; Mon, 4 Apr 2022 18:43:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpPUC17y4mkWtGw/xOv/TO9nvo+a2Bwq88NJg/3QW2lyBNup0lhJ/P3Kaa45bU8T3uJFsx X-Received: by 2002:a65:45c1:0:b0:382:2edd:fcc4 with SMTP id m1-20020a6545c1000000b003822eddfcc4mr850726pgr.559.1649122995417; Mon, 04 Apr 2022 18:43:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649122995; cv=none; d=google.com; s=arc-20160816; b=iOmTAV8Y05mKnqvMrHBP381Ud29f5xapqkE+IC+cG1XYAd/zNfgWreJJvpJ53B/siJ 4VTnpFwqy0dCTAiljmnIjqsTsBnYMcVm3dl7OXS65HUTbMCdsWG58Q0YmhI5hEtDcY/K +0wm1cHTTWpEcnvejgqRntVAJz2lOF6dIl/p//zBoBGwv5HOFCQ7QX1G81bdMYYq3oov o6g1yoEtgj2nBbgHDDOJyl/4ntQr8SymsIiHLAG52kQrqeFbHBheqmmKTkWovT1GHsKW qvnN6jYur9uAMu8j8erShsV8qPPdspo4cumjfIXhbUwIlD8xwPUO37HT2fMzvvFSFCpn 2ugQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fnHL5Eg2HNb9umhQEOqVpPkYLtFyzOj1D6QtOB4O0O4=; b=o2tEWPLKHDHT9QH1jy8xiZeV0+vxHjXcCn805tMqyZjOWGoYBOrjSLKQ+bpOltIZ3O TrJ/vUEQOFR8qEUwHVOxnY70245yzb7vDfZ2OUHYVdhECcouGupzfqYM4NPrQqgsNA53 DwTrSoBpRL09uJc4FPNLTmE8p0E79MZy9YvrSf7/tJaAxWfJwxhFh+MViNtg+aWF2SFM qnTRJPvNGRrEoGvungodOQbA9bprhkejeBaYzlV72bmfue6u5rylyrlFLlErqUy6gKa9 FUZ8vhvLUFv/Q6cfVim5UEEzBEzIcm2QYAU2KJhhwwWI4wNcW2mR6WvNkO5ERXyDRD8G VsoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bRLeII3R; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b15-20020a170903228f00b00154c1348e40si12361062plh.497.2022.04.04.18.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 18:43:15 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bRLeII3R; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B723C29EE32; Mon, 4 Apr 2022 17:41:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347305AbiDAObi (ORCPT + 99 others); Fri, 1 Apr 2022 10:31:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347192AbiDAOan (ORCPT ); Fri, 1 Apr 2022 10:30:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7737286F64; Fri, 1 Apr 2022 07:27:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7451461C19; Fri, 1 Apr 2022 14:27:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4674BC2BBE4; Fri, 1 Apr 2022 14:27:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648823254; bh=JsYgHBNMMGGDkT6RyF3xvDVWNM/IpQ6TT1R5Sk0yN6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bRLeII3RzPGE/Hx6Wur7frs3kZhLLGBxghWEZmGGTbAfZqBd3S/Lwu90FIA8fHWz5 SZRI6jYSG4kRzkGr9e5KcsJA1c2ft2EDNI+c7tcvi2ljRP+N1OnosPbAun20hk7EOx XSiY/Feo17Deq3SfGiRM5qOFK8vKxcLkbUsECkLORJ/CwuhUqVknJTaAjUZ4V7dsEG f8C3m4kvNdJjNOe+XBo+jn1gnP4MWJsTie6B4RgfrCtbIKtau2+gR0TzWrQ76Qrm31 r1SP7H58Q2DEYpwYKW4H5XonxPdkn7M9HAdUJvQENOTe+p7s562FVVWHUqJpoJSlfT O4+k8lqE2474A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yang Guang , Zeal Robot , David Yang , "Martin K . Petersen" , Sasha Levin , jejb@linux.ibm.com, john.garry@huawei.com, bvanassche@acm.org, yuyufen@huawei.com, himanshu.madhani@oracle.com, thunder.leizhen@huawei.com, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 5.17 035/149] scsi: mvsas: Replace snprintf() with sysfs_emit() Date: Fri, 1 Apr 2022 10:23:42 -0400 Message-Id: <20220401142536.1948161-35-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220401142536.1948161-1-sashal@kernel.org> References: <20220401142536.1948161-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Yang Guang [ Upstream commit 0ad3867b0f13e45cfee5a1298bfd40eef096116c ] coccinelle report: ./drivers/scsi/mvsas/mv_init.c:699:8-16: WARNING: use scnprintf or sprintf ./drivers/scsi/mvsas/mv_init.c:747:8-16: WARNING: use scnprintf or sprintf Use sysfs_emit() instead of scnprintf() or sprintf(). Link: https://lore.kernel.org/r/c1711f7cf251730a8ceb5bdfc313bf85662b3395.1643182948.git.yang.guang5@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Yang Guang Signed-off-by: David Yang Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/mvsas/mv_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c index dcae2d4464f9..44df7c03aab8 100644 --- a/drivers/scsi/mvsas/mv_init.c +++ b/drivers/scsi/mvsas/mv_init.c @@ -696,7 +696,7 @@ static struct pci_driver mvs_pci_driver = { static ssize_t driver_version_show(struct device *cdev, struct device_attribute *attr, char *buffer) { - return snprintf(buffer, PAGE_SIZE, "%s\n", DRV_VERSION); + return sysfs_emit(buffer, "%s\n", DRV_VERSION); } static DEVICE_ATTR_RO(driver_version); @@ -744,7 +744,7 @@ static ssize_t interrupt_coalescing_store(struct device *cdev, static ssize_t interrupt_coalescing_show(struct device *cdev, struct device_attribute *attr, char *buffer) { - return snprintf(buffer, PAGE_SIZE, "%d\n", interrupt_coalescing); + return sysfs_emit(buffer, "%d\n", interrupt_coalescing); } static DEVICE_ATTR_RW(interrupt_coalescing); -- 2.34.1