From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752628AbcGMKYZ (ORCPT ); Wed, 13 Jul 2016 06:24:25 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:53515 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751281AbcGMKYR (ORCPT ); Wed, 13 Jul 2016 06:24:17 -0400 X-IBM-Helo: d03dlp02.boulder.ibm.com X-IBM-MailFrom: xinhui.pan@linux.vnet.ibm.com From: Pan Xinhui To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@redhat.com, Waiman.Long@hpe.com, Pan Xinhui Subject: [PATCH] locking/pvqspinlock: Fix a bug in qstat_read() Date: Wed, 13 Jul 2016 18:23:34 +0800 X-Mailer: git-send-email 1.9.1 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16071310-0028-0000-0000-0000052779D8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16071310-0029-0000-0000-00002D79B27B Message-Id: <1468405414-3700-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-07-13_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607130117 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's obviously wrong to set stat to NULL. So lets remove it. Otherwise it is always zero when we check the latency of kick/wake Signed-off-by: Pan Xinhui --- kernel/locking/qspinlock_stat.h | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/locking/qspinlock_stat.h b/kernel/locking/qspinlock_stat.h index 7b0f1b9..8fa1165 100644 --- a/kernel/locking/qspinlock_stat.h +++ b/kernel/locking/qspinlock_stat.h @@ -157,7 +157,6 @@ static ssize_t qstat_read(struct file *file, char __user *user_buf, */ if ((counter == qstat_pv_latency_kick) || (counter == qstat_pv_latency_wake)) { - stat = 0; if (kicks) stat = DIV_ROUND_CLOSEST_ULL(stat, kicks); } -- 1.9.1