Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2612015pxb; Sun, 17 Oct 2021 20:28:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoRIsd31HBG0AyBX/4OXFLZa0n9JxT+XZlW3Wcz7xjm9xGguPMTwZqxQI2/THHcWc/CPmL X-Received: by 2002:a62:e40a:0:b0:44d:a86:43ce with SMTP id r10-20020a62e40a000000b0044d0a8643cemr26532500pfh.69.1634527723352; Sun, 17 Oct 2021 20:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634527723; cv=none; d=google.com; s=arc-20160816; b=v7eEgf603kdH36K7jp8kIU+xfqdX8Dtkd5lD3MkzHFYIBzBnyH1oL8CY1ZJVajqzKE wfoccnGof+D6fN28OAlN1Z/SIQNuG17OUpB7s6GbKYA+faweutewxG/HTKQc85JI8/Cw NgQqBsen22dKMvUoz6eMYDx8+VQ5RtOHVgzlz4DUPLXRvsbJIl3zEMoKyi1WdA4vWUka upfF7SW5IiOQPrXS5mtsPlB2SLKl6uFIdfid2xQUP2wPwPdy/mhn2f+07mlfVAp50Ws+ IN+ttcH9jzaq/Al9sDFItkp4hyd95NqpZ8/mtqKBhyBPymcYF1BL1krvvFXokXGaEBGn 1mQw== 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=on0toj9KSB/P1ZdoFXa8VRFzAq1o2qoRpp+fCqcl/Pc=; b=P7cXVFO4w0rsXhmPBjDyQTnpvtDKigWy9wZruWIJcya13hgo84NFJ5sFVWoTKpK2eF Qmroqp4ykOFx/rDN7aBxp8CCSEpRHsTduTiOccBRCS6HZmWKV19/uGXOznotq1UrqTk1 qO6hpQrxp4b4IgIKOgt/Nb+/Ps3N2g8epQg7EMiFnMxdHUHVDsLVXM+GJzPFUZkSBVI0 KivOnsbULpBmXdyZfwUK8IAiOlgsHgP2g/3W12qVuALbfMxC9Vf4NAU0AmM7LDxRS3HL k5Fud6rcjjYvmJX7BfdFRGX8r8dz70ytgOSu0RRhuVtPYp9AxjE13yhgCxU+fWCf9wXi h4DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=olWqvhIj; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h191si2962950pge.456.2021.10.17.20.28.30; Sun, 17 Oct 2021 20:28:43 -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=@kernel.org header.s=k20201202 header.b=olWqvhIj; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239576AbhJPGs6 (ORCPT + 98 others); Sat, 16 Oct 2021 02:48:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:60952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236583AbhJPGs5 (ORCPT ); Sat, 16 Oct 2021 02:48:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4C1CF61108; Sat, 16 Oct 2021 06:46:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634366810; bh=ahnp24X17vL4giBapwgLqsYQxgIgv2RuRJVI0FsVq4E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=olWqvhIje6THog/VYiX6uFRrRFyYUj6/9gZ41PjXLWU19WrggyOW6w46XrtDja0Ao 1gbpiC/m6MT3wMFWbNCKDXE4l3fQI9cGcyejxZH9Os1vVZL8mRESNcFvywOpT6F3vt muYcOp5hCxTuOV7MF3FlnHPCn1Sg+YDoEYjs+R8FZUxS0Zl/O14sHhc1ZrIaWXFM5W CjW+Vs2G/RHy0Q7q+JNZBdHUIjSS597FKyxG6iBMJjr9A9PU6iS+vHsx8XjaQql+VE RhEenCAGYdSy2I81JBWpf3RywZ+EO2Q939/VYwfarXWqrL1JcyjTwptPUN3jAs9GSF ezeLRtEQ2KUYQ== Date: Sat, 16 Oct 2021 12:16:43 +0530 From: Manivannan Sadhasivam To: Qing Wang Cc: Manivannan Sadhasivam , Hemant Kumar , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bus: mhi: replace snprintf in show functions with sysfs_emit Message-ID: <20211016064643.GA23491@thinkpad> References: <1634095550-3978-1-git-send-email-wangqing@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1634095550-3978-1-git-send-email-wangqing@vivo.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 12, 2021 at 08:25:50PM -0700, Qing Wang wrote: > 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: Manivannan Sadhasivam Thanks, Mani > --- > 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 c81b377..f3ddefe 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.7.4 >