Message ID | Y9Q5Tt8c9WBDxeyV@ubun2204.myguest.virtualbox.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1045380wrn; Fri, 27 Jan 2023 13:10:37 -0800 (PST) X-Google-Smtp-Source: AK7set/splDaqTehQYBSJUlf/PIeyFSQFkQ/uqbCDkipwpk6Owu+j9tH/sgau6O35f2149Dz/UDf X-Received: by 2002:a17:90b:1b11:b0:22b:f76c:4585 with SMTP id nu17-20020a17090b1b1100b0022bf76c4585mr14706503pjb.2.1674853837414; Fri, 27 Jan 2023 13:10:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674853837; cv=none; d=google.com; s=arc-20160816; b=AxQoCOOY3GfIB5z7AqXijRJ65yf2MfOT3IYH4ZfWveMbCYKeLRtSXwl0tW6GWelXRc AP+IMUKcjfyxuqF9sH6cYq+MXUwsC9U+k2Ka4YH2goF8+SFfAS3XZxoTumSvmdNOfLZe kmG0uapJPEonsdWRKNEZ1T1IIwLqGWLyEqWTC7YHnjil2NQe+P/966Jb5uipRnviR5IW TgtWCTbg2aynwl4zWUR7hDBkgZDAMoCHoaJI3j4cfJeQy5W1UpWe03uT5xKoEU4g6bm4 q1Oco6v4qYcBsEveTfVhq9SbDZOcQ7FJvjrE+zoGxiAQBOBhYJWnixW5TO+S2jz+YNxv 0iJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=hZjS6FpHwKW+Db6mrG4m6YKXRc0pWJga2UvCatiBqRQ=; b=Mcv0Maie3d5czFScPFTdtkAd/O+3CaSM/e2mU7CfBGFqxFusGqgudYidnMVGzJsjWm adEFqgsjLCFIkYwJLoGurF6XhIpf40QSZ+kcy6eFoA+VkFcPcvaJTKIZyuZlIM+LH9D4 tQjA6LPeVIQ5ZQ4Q7oC8K9/EYh8meRUhhYZwDcBHtkQquh/R4Q8hf7DGwaaIy1jcTZmC yBbdrv+q8AD95oSLybpQe8WYl5+ZxSStNiMD9qRjrfo5kA6sUGhn9e43Dz+s5n1l6dv4 pF3s3NIc5wxuc/z5ubiuYyVTSPlRhqgaGJ1Sp9XAFR5Kxi7zY1vyv+1JG/W+UW0xAuCs T2Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=MHMtbPas; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q18-20020a17090a2e1200b00229a01b218bsi5614946pjd.19.2023.01.27.13.10.24; Fri, 27 Jan 2023 13:10:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=MHMtbPas; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230515AbjA0Uvs (ORCPT <rfc822;lekhanya01809@gmail.com> + 99 others); Fri, 27 Jan 2023 15:51:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbjA0Uvo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 27 Jan 2023 15:51:44 -0500 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9FEF7EFEE for <linux-kernel@vger.kernel.org>; Fri, 27 Jan 2023 12:51:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1674852690; bh=r9cSBMJn3mflOnLsA3kDjd8yrjkKnm2dAF4ZyKs29kM=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=MHMtbPasMSOeq8cITgqud6o5CzxVy9BQenqnHND+tbn1l1lhHFXaytnKCwUaujVEi pWeVwN542Eg2KjKx1CmJpbBTLH1BMZR6In8uYl9WXpzNmHECRP2pdGNrrBJB954+Px h2fwo65Bglntb2HoG65hrBhTZW7Y+M48jf/rAngw= Received: by b-3.in.mailobj.net [192.168.90.13] with ESMTP via ip-206.mailobj.net [213.182.55.206] Fri, 27 Jan 2023 21:51:30 +0100 (CET) X-EA-Auth: 1zJc8Axf3sxItJw3RXYEjDVc497uFzsAFgO+gLFtm8VMZrSooyg8jW3dWmc5Q86OzEgdtkYdkiEUW3tRKFAqdHgMkJfmXOHT Date: Sat, 28 Jan 2023 02:21:26 +0530 From: Deepak R Varma <drv@mailo.com> To: Liviu Dudau <liviu.dudau@arm.com>, Brian Starkey <brian.starkey@arm.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar <ssengar@microsoft.com>, Praveen Kumar <kumarpraveen@linux.microsoft.com>, Deepak R Varma <drv@mailo.com> Subject: [PATCH] drm/arm/malidp: use sysfs_emit in show function callback Message-ID: <Y9Q5Tt8c9WBDxeyV@ubun2204.myguest.virtualbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756211537807435802?= X-GMAIL-MSGID: =?utf-8?q?1756211537807435802?= |
Series |
drm/arm/malidp: use sysfs_emit in show function callback
|
|
Commit Message
Deepak R Varma
Jan. 27, 2023, 8:51 p.m. UTC
According to Documentation/filesystems/sysfs.rst, the show() callback
function of kobject attributes should strictly use sysfs_emit() instead
of sprintf() family functions.
Issue identified using the device_attr_show.cocci Coccinelle script.
Signed-off-by: Deepak R Varma <drv@mailo.com>
---
drivers/gpu/drm/arm/malidp_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Sat, Jan 28, 2023 at 02:21:26AM +0530, Deepak R Varma wrote: > According to Documentation/filesystems/sysfs.rst, the show() callback > function of kobject attributes should strictly use sysfs_emit() instead > of sprintf() family functions. > Issue identified using the device_attr_show.cocci Coccinelle script. > > Signed-off-by: Deepak R Varma <drv@mailo.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> I will push the change into drm-misc-next by the end of the week. Best regards, Liviu > --- > drivers/gpu/drm/arm/malidp_drv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c > index 589c1c66a6dc..cf040e2e9efe 100644 > --- a/drivers/gpu/drm/arm/malidp_drv.c > +++ b/drivers/gpu/drm/arm/malidp_drv.c > @@ -649,7 +649,7 @@ static ssize_t core_id_show(struct device *dev, struct device_attribute *attr, > struct drm_device *drm = dev_get_drvdata(dev); > struct malidp_drm *malidp = drm_to_malidp(drm); > > - return snprintf(buf, PAGE_SIZE, "%08x\n", malidp->core_id); > + return sysfs_emit(buf, "%08x\n", malidp->core_id); > } > > static DEVICE_ATTR_RO(core_id); > -- > 2.34.1 > > >
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 589c1c66a6dc..cf040e2e9efe 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -649,7 +649,7 @@ static ssize_t core_id_show(struct device *dev, struct device_attribute *attr, struct drm_device *drm = dev_get_drvdata(dev); struct malidp_drm *malidp = drm_to_malidp(drm); - return snprintf(buf, PAGE_SIZE, "%08x\n", malidp->core_id); + return sysfs_emit(buf, "%08x\n", malidp->core_id); } static DEVICE_ATTR_RO(core_id);