Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2612510pxb; Sun, 17 Oct 2021 20:29:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5LrILZ30+fgZ0Nij2/ZLVWbXJ81ZH+JT/qmpL98sxZpr9kNNGLm5eJtmko0TB0+8G6sfC X-Received: by 2002:a65:64c3:: with SMTP id t3mr21100369pgv.244.1634527789723; Sun, 17 Oct 2021 20:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634527789; cv=none; d=google.com; s=arc-20160816; b=AQTY64KzuNImobWospKxeRu6RRoTk/iW39/EEvv7X1mLiHZ1ilKnieucGX6PgAjuGi zRj2pnrM2HVymQCMfsjt0YToelGMq46q3XuphNIA621/AIZjFAinb0Ia3ZTl8CCkFYwm 6vCEk8SY4ZwtxNla0Pf03nDkB9J2Qrj0qRn5pnGnSnibi123QHeNjuF+StyanOLgg4mo BuCM7VKfJN5JHnCmB+f5f1ip5WuyNP19JBnyuNgv+coI22XC1g9TAyOkE9dujQbPBCB+ u6nT4Db4BH+uWJe8tDEv0FNWD1LwPPbN7dIlgz52im3GUX1LpQ3640bUIgTJ68t+1RKf Szjw== 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=PSnBBHmQDKKzZaMOl+dSnVydeHhc9eP8o2lCcovzMc8=; b=Pu+jo2Ukr4vnQBXvxLpzZdhvxdVnCmqjm7gUPX5JOmDYSM5TcS3IxMS+BBW8c9Ik5h WgpvCvUMUjIiHfDiBnzfTJtmCxj1cYZdC61G9VgrvBjqC9KWpQuqjY3CMCRVRT7hQbLk l+qf5zXabrNdC93rRWgL3XqOH5HyJNOS7lIwairB58OqDAQXEgVHxYCPY7NQvg2yrXp0 TBsN0uAq88Y3vstRGGyDhM+vS7oE02bkxkBDDZO2JyaRlF3iAsKbt2ujcB2K/SYT6Hdc AJP1IC68f+u+9YI2tT1zpRizGc2e00JJGtx8oWuoA4QFUNWtao3vUwhX7HtSSO6shApD EOFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w8tJccHI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e25si5168463pgv.258.2021.10.17.20.29.38; Sun, 17 Oct 2021 20:29:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w8tJccHI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243703AbhJPHAO (ORCPT + 98 others); Sat, 16 Oct 2021 03:00:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243712AbhJPHAM (ORCPT ); Sat, 16 Oct 2021 03:00:12 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7C52C061764 for ; Fri, 15 Oct 2021 23:58:04 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id r2so10628924pgl.10 for ; Fri, 15 Oct 2021 23:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PSnBBHmQDKKzZaMOl+dSnVydeHhc9eP8o2lCcovzMc8=; b=w8tJccHIf6PPWVXEA/XDUTRC3rJpIf9L7f+3DeKSYA69hhp3JJ2+ro4Fv9KZ/Xq/9m dUO/uHgMzKPjtT8E5gD8qQ3bDhGJSFJu0B+gTihLrXduYR2t/DNvcoqe9oZKdM8yZVqI jPmC1gOU21d28VUAfcuahRmg3+gPdzsppjQLLOJr1rIXfDuwNUY6pqIELm0nsw3TYS01 m7aq4vloUggNOYskY6X1O5CTeBlC0Qa9C6oDLoDKDRmOqJ/EJaWLyfQ/43DBP3ZjYl0Q /DfsSiG06mH22sX0cIuCoGUfofelm2Jxy2AtObZ9cxv2p1WFrjcgRGYaEptNJOT0YBEU 2X1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PSnBBHmQDKKzZaMOl+dSnVydeHhc9eP8o2lCcovzMc8=; b=mrfRqNm89BFB1SxIja4NzVAgMl7IDLs/Q3gnyE3aZwV+G9UOc+KKwxsag0XwYpYiGe Xsu/bVvY5KsaNIvt3EDHE+5KwruyKjlWRHajeNjmD+lcfbPsLUKNSO2kzgn2ornMMhuj mw+sx8R+n0bSXDrVCfgXZ3GsXL3vGgmR8eGNeJMTuL8SVJh4medxzMGOqNwLtoCI+QIA eqlZ0hp4DEkJJbfpTxcz69jsACgfIWUeV5VNy4o5NJDLdOSZ3vwuGUCNsy8y4yV93MwK 8mmZ81j9V2jtu7EzRyFY8MYFUf4hBgJHzSZWp617DoZTN86lnTolgcBBBWPtVMqQto/l L1gA== X-Gm-Message-State: AOAM533hib8mZq5Jw7/KgeUCFH5G92iVLd1lclEYKlXfvlZUDpj0szzq WJhV54BSIBZvC7YnWdjHafeU X-Received: by 2002:a63:20f:: with SMTP id 15mr12477340pgc.319.1634367484257; Fri, 15 Oct 2021 23:58:04 -0700 (PDT) Received: from localhost.localdomain ([117.202.185.237]) by smtp.gmail.com with ESMTPSA id a17sm7024253pfd.54.2021.10.15.23.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 23:58:03 -0700 (PDT) From: Manivannan Sadhasivam To: gregkh@linuxfoundation.org Cc: hemantk@codeaurora.org, bbhatt@codeaurora.org, loic.poulain@linaro.org, wangqing@vivo.com, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam , Manivannan Sadhasivam Subject: [PATCH 3/3] bus: mhi: replace snprintf in show functions with sysfs_emit Date: Sat, 16 Oct 2021 12:27:34 +0530 Message-Id: <20211016065734.28802-4-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211016065734.28802-1-manivannan.sadhasivam@linaro.org> References: <20211016065734.28802-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qing Wang coccicheck complains about the use of snprintf() in sysfs show functions. Fix the following coccicheck warning: drivers/bus/mhi/core/init.c:97:8-16: WARNING: use scnprintf or sprintf. Use sysfs_emit instead of scnprintf or sprintf makes more sense. Signed-off-by: Qing Wang Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/1634095550-3978-1-git-send-email-wangqing@vivo.com Signed-off-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index 5aaca6d0f52b..a5a5c722731e 100644 --- a/drivers/bus/mhi/core/init.c +++ b/drivers/bus/mhi/core/init.c @@ -94,7 +94,7 @@ static ssize_t serial_number_show(struct device *dev, struct mhi_device *mhi_dev = to_mhi_device(dev); struct mhi_controller *mhi_cntrl = mhi_dev->mhi_cntrl; - return snprintf(buf, PAGE_SIZE, "Serial Number: %u\n", + return sysfs_emit(buf, "Serial Number: %u\n", mhi_cntrl->serial_number); } static DEVICE_ATTR_RO(serial_number); -- 2.25.1