Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3262088pxb; Mon, 18 Oct 2021 11:24:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJd+VCwLtQpf88gT/kFdNTRbAKnXMQkwhACozY6a58rf3XWWEcgTxkcqofgg6iDBv6EQJU X-Received: by 2002:a17:90a:e7c6:: with SMTP id kb6mr616032pjb.84.1634581482866; Mon, 18 Oct 2021 11:24:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634581482; cv=none; d=google.com; s=arc-20160816; b=jbcmiWcjE8UsBImyXCu2kvQkoaIl9aZB08UYq9Q1mAVKyzoSvKyMTMaga4P0iz1X9Q 6JNMvVcC6vgKu/vDGidiOHAGsI8/Sdx4CLg6RYtl45mWySXQQ0Cx/+Ik1Mytn9aCn4Y2 Ml0DmmRdwu5BZYvyyJ8oTj7iSP53nkWXi+WB7YfuQVyniphC0fG2i2Y4Z5B1WqzbJ8CL k5o6vE379iKaVLAyOpwTBwfxUHz5tVfHCd51yURNtqCIp2arU4ODbDTd0Ua+skPVZeV8 K8umeI3o+vtn0WiqHde92AHMyqx78TIOF3HMs4HHzJ5QynFQmmfdKcV7jp1B7fb1Vw9V QZ1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:user-agent:date :mime-version:references:in-reply-to:to:from:subject:message-id; bh=EMyHyxLV46kvBmlMhtRRqG+HBTkY9wlJEhMkG+n7nSQ=; b=Z5nRtoP+Pm5T1i5lnptd5N8y8opduyBErAFvTfSC1JAo7Z7F7qArqB7E7N9dS0A3Kb ZfeiUdco0OPo3vJ9FUDMR6X4eHUL2Qnol56XfChJa4Xkzhp8XWM69mxbrkKiW7d0KtWa M/Rp/lAiDNt8acMe1ake/BTGzbyD8e2oH+EG4NiZdl0/anyoeacwGmHjelqkeklmwLDJ bN4EIeKIxJ7lZGNlL2Mqrmt48ihCqA+IyoFzQrHuX0N2hSh6iEr5lxDOx6Rqzq0T5das SLOXyBzB53CwG1zWpB3mZXAQTbJIgnvVZOFSZRJ9/RYJ8/F+NFc1M3KZPzTWvPAO7GWK +TDQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i20si19832464pgk.180.2021.10.18.11.24.29; Mon, 18 Oct 2021 11:24:42 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232603AbhJRSYs (ORCPT + 99 others); Mon, 18 Oct 2021 14:24:48 -0400 Received: from smtprelay0087.hostedemail.com ([216.40.44.87]:34592 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232608AbhJRSYr (ORCPT ); Mon, 18 Oct 2021 14:24:47 -0400 Received: from omf11.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 50382181D68DB; Mon, 18 Oct 2021 18:22:34 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf11.hostedemail.com (Postfix) with ESMTPA id ABD3A20A297; Mon, 18 Oct 2021 18:22:32 +0000 (UTC) Message-ID: Subject: Re: [PATCH] s390: replace snprintf in show functions with sysfs_emit From: Joe Perches To: Vineeth Vijayan , Qing Wang , Stefan Haberland , Jan Hoeppner , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Peter Oberparleiter , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <2b1b939e1ea960c2268791f3007305955a70a90f.camel@linux.ibm.com> References: <1634280655-4908-1-git-send-email-wangqing@vivo.com> <2b1b939e1ea960c2268791f3007305955a70a90f.camel@linux.ibm.com> Content-Type: text/plain; charset="ISO-8859-1" MIME-Version: 1.0 Date: Mon, 18 Oct 2021 07:20:39 -0700 User-Agent: Evolution 3.40.4-1 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspamout05 X-Rspamd-Queue-Id: ABD3A20A297 X-Spam-Status: No, score=-2.64 X-Stat-Signature: k6gtg8qg4bm3f9b6ixg5bdepsjia3h5w X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+E0FhiHCg+F/OTIuiyA/MW2dW4ngF7I84= X-HE-Tag: 1634581352-566392 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2021-10-18 at 13:50 +0200, Vineeth Vijayan wrote: > Acked-by: Vineeth Vijayan [] > On Thu, 2021-10-14 at 23:50 -0700, Qing Wang wrote: > > show() must not use snprintf() when formatting the value to be > > returned to user space. [] > > diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c [] > > @@ -731,7 +731,7 @@ static ssize_t dasd_ff_show(struct device *dev, [] > > - return snprintf(buf, PAGE_SIZE, ff_flag ? "1\n" : "0\n"); > > + return sysfs_emit(buf, ff_flag ? "1\n" : "0\n"); It's more common to use return sysfs_emit(buf, "%d\n", ff_flag); > > @@ -773,7 +773,7 @@ dasd_ro_show(struct device *dev, struct [] > > - return snprintf(buf, PAGE_SIZE, ro_flag ? "1\n" : "0\n"); > > + return sysfs_emit(buf, ro_flag ? "1\n" : "0\n"); etc...