Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4423484ybg; Mon, 8 Jun 2020 07:33:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyo9zxeVDLPJTUlqxgUfa38zpSV+Sm7uieEaLRoGbM4m27UFr5pokQrVdSPygK8E0rb1LxU X-Received: by 2002:a50:fd19:: with SMTP id i25mr22032110eds.248.1591626785979; Mon, 08 Jun 2020 07:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591626785; cv=none; d=google.com; s=arc-20160816; b=kCb3GI0e1GwlO5gsiiSagNR6FXLYHIYOc4RlO1ZvUIXZFGAeX8O3JPOdWTqPxxjRKi sGJ1ZBaFDY67X2Tpl8SG2AbyU1i1L8F/W/UplUFrTIB0qg81g7tHVwMYDL5cLayo7IfD Bd8N2Qhj7ztEyW0kyNx2/fnUJdHTWAkFlBLJ2orXdnVBS/4aiug1t5jDLYKThpGptt7g qQ/vuJkFqlOikaHu//zqPo3xXdbjxZ9u7ZGcygH5EK8pwYMlHQcu1O+sc+Vnp8p9JR5N c4X1vRrQ+3e6Cd1ct1Q1P7KbU+WUZOYZM2j+Gk4mrf0beagSTUEqgpcyRj0w/3DnPgE2 1/dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=SARrIBD3JyX/V+5g1umhQFgNc6ZLstkJAhGAzrNH0wg=; b=BWoJicixYQaM+GmWG+PMfOWZpoFbByz+r2tGkx9QQy3U7DbHjS0wUeKpobuQv716NY zzhYyBqMJuctRQBJkPVsTGTCHTCHblf2jm47y7YiYPjuzYz2ff9eDKnzlecnQNMlFanS KZ+VcgZMHBfO4OUr1lhCSRfYNL26rrn2mqq4m/TKoB5BxI8idJJu+KGs0x6/v4UK1kst hpGLNH5aYCATl/R2fN1qHAoZmiFwX9lNttxvzJ+/Kbtynx6n8tmYFluA6RE+K5S0X1ED rBegnoJGSwXrMXMhOU9SNTKRr5PCZTa1q1jJGtTgqQ+yVEhW0rm4tLIUNAs0qNN6M6HZ dJng== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm9si11255989ejc.624.2020.06.08.07.32.42; Mon, 08 Jun 2020 07:33:05 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730010AbgFHO2g (ORCPT + 99 others); Mon, 8 Jun 2020 10:28:36 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:18964 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbgFHO2g (ORCPT ); Mon, 8 Jun 2020 10:28:36 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 058EM3Dr028140; Mon, 8 Jun 2020 10:26:26 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 31g41dvbs7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Jun 2020 10:26:23 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 058EPDg2017538; Mon, 8 Jun 2020 14:26:01 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma03ams.nl.ibm.com with ESMTP id 31g2s7v50c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Jun 2020 14:26:01 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 058EPwXY23855244 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 8 Jun 2020 14:25:58 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C889F4C05A; Mon, 8 Jun 2020 14:25:57 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8DE9E4C059; Mon, 8 Jun 2020 14:25:57 +0000 (GMT) Received: from osiris (unknown [9.171.20.146]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 8 Jun 2020 14:25:57 +0000 (GMT) Date: Mon, 8 Jun 2020 16:25:56 +0200 From: Heiko Carstens To: Chen Zhou Cc: gor@linux.ibm.com, borntraeger@de.ibm.com, linux-s390@vger.kernel.or, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next 0/3] s390: use scnprintf() in show() methods Message-ID: <20200608142556.GA7478@osiris> References: <20200509085608.41061-1-chenzhou10@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200509085608.41061-1-chenzhou10@huawei.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.687 definitions=2020-06-08_13:2020-06-08,2020-06-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 phishscore=0 adultscore=0 malwarescore=0 impostorscore=0 clxscore=1011 mlxlogscore=839 bulkscore=0 suspectscore=1 cotscore=-2147483648 priorityscore=1501 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006080104 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 09, 2020 at 04:56:05PM +0800, Chen Zhou wrote: > snprintf() returns the number of bytes that would be written, > which may be greater than the the actual length to be written. > > show() methods should return the number of bytes printed into the > buffer. This is the return value of scnprintf(). > > Chen Zhou (3): > s390/crypto: use scnprintf() instead of snprintf() > s390: use scnprintf() in sys_##_prefix##_##_name##_show > s390/protvirt: use scnprintf() instead of snprintf() > > arch/s390/crypto/prng.c | 14 +++++++------- > arch/s390/kernel/ipl.c | 2 +- > arch/s390/kernel/uv.c | 8 ++++---- > 3 files changed, 12 insertions(+), 12 deletions(-) All applied, even though the buffer has a size of 4k in all cases. So this doesn't fix anything; but it doesn't hurt as well.