From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751305AbdKVGbU (ORCPT ); Wed, 22 Nov 2017 01:31:20 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:49312 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751079AbdKVGbT (ORCPT ); Wed, 22 Nov 2017 01:31:19 -0500 Subject: Re: [PATCH v1 3/9] perf util: Reconstruct rblist for supporting per-thread shadow stats To: Jin Yao Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com, Ravi Bangoria References: <1511189024-19908-1-git-send-email-yao.jin@linux.intel.com> <1511189024-19908-4-git-send-email-yao.jin@linux.intel.com> From: Ravi Bangoria Date: Wed, 22 Nov 2017 12:01:32 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1511189024-19908-4-git-send-email-yao.jin@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 17112206-0040-0000-0000-000004113756 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17112206-0041-0000-0000-000020B402F2 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-22_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711220090 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/20/2017 08:13 PM, Jin Yao wrote: > @@ -76,6 +97,17 @@ static struct rb_node *saved_value_new(struct rblist *rblist __maybe_unused, > return &nd->rb_node; > } > > +static void saved_value_delete(struct rblist *rblist __maybe_unused, > + struct rb_node *rb_node) > +{ > + struct saved_value *v = container_of(rb_node, > + struct saved_value, > + rb_node); > + > + if (v) > + free(v); > +} Do we really need if(v) ? Thanks, Ravi