From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C7E2C433FE for ; Wed, 9 Nov 2022 07:46:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229834AbiKIHq0 (ORCPT ); Wed, 9 Nov 2022 02:46:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229530AbiKIHqX (ORCPT ); Wed, 9 Nov 2022 02:46:23 -0500 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CDDA186FE for ; Tue, 8 Nov 2022 23:46:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1667979968; bh=4y+p6G+6Eyrf3pYDyQ3PW7+HxDBRFvP76sfcfvr405o=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=Tx3A3hiw1+wUw/GGd3EY1Vy10Eu0OfaNks4pN6IpVUGYN0NPsu7J6GTniwOdr2OS+ OrFvVOtSWLzW4iqDe6C5CaMXmc4BPWWE27bCpCW3421zQSqM+JUCn+00wnXvZ1pijO sPkMmsgjE5CZvrPAxec1kwNX0kFus2Tg3CMOiXIE= Received: by b-1.in.mailobj.net [192.168.90.11] with ESMTP via ip-206.mailobj.net [213.182.55.206] Wed, 9 Nov 2022 08:46:08 +0100 (CET) X-EA-Auth: 5WhwHM9XqEWUpElfHoVsyiSNRigbkBV1oekffDsZQS3OO3TMni5CBDdtyn7IdurPP3ccJ3dnRKFudoW0pY8qUOwkWzy7vJiN Date: Wed, 9 Nov 2022 13:16:02 +0530 From: Deepak R Varma To: Greg Kroah-Hartman Cc: outreachy@lists.linux.dev, Sven Van Asbroeck , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] staging: fieldbus: replace snprintf in show functions with sysfs_emit Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 09, 2022 at 08:30:26AM +0100, Greg Kroah-Hartman wrote: > On Wed, Nov 09, 2022 at 11:26:52AM +0530, Deepak R Varma wrote: > > The show() methods should only use sysfs_emit() when formatting values > > to be returned to the user space. > > Ref: Documentation/filesystems/sysfs.rst > > Issue identified by coccicheck. > > > > Signed-off-by: Deepak R Varma > > /* > > - * card_name was provided by child driver, could potentially be long. > > - * protect against buffer overrun. > > + * sysfs provides PAGE_SIZE long buffer to take care of potentially > > No need to ever mention PAGE_SIZE at all, this comment should just be: > /* card_name was provided by child driver */ Sure. I will update the comment in the revision. > > But the larger question is, why did you only convert one of the sysfs > show functions in this file? Why not do them all? I was limiting it to what is reported by coccicheck. I will review other such show functions and send a consolidated patch. Thank you, ./drv > > thanks, > > greg k-h >