Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4245824ybp; Mon, 14 Oct 2019 01:18:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJegqkb3++eFeZKPdMGaGkrqJQFzYzLZD6bYq5QoLz2jUnGQnFiiHAFnypkBtKTiLZd/kb X-Received: by 2002:a05:6402:8cf:: with SMTP id d15mr26007965edz.225.1571041082275; Mon, 14 Oct 2019 01:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571041082; cv=none; d=google.com; s=arc-20160816; b=Tz9gdCySSPm5OookwpI1fNlC9iHYWTQh0daH6toLGb048a4TLsGvIzpTDDzhDqsa3p gRpFlgktzgn0PNDRtKWLShmJ+yo9hAS4sLNNh5K6yqah6gvzyGaKPw85pj5472b62y5/ Kkw3FVZTk25uFeZGxIRh5aSGE1Q/ISKnrDtFnS7hY6o8F5k9lRTIBz8nTiYJ6d5G4vS2 I0tWEOOJKweR7ucOG4Rh4wsBOAUxWS0Cdd1DNBH4hWGzXPR+uolCbDqpXmw1Giw253j+ bcjtI51Jz8qcXnglZU0eFrrh4/Pel9a19oYnB6zByfJeLkg404zgTMJc/0Td1TsLVL3G l5pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=bHIREbwp+rVeoPES74rrHcVGd27XFEe41eNjCAz1OTw=; b=VyvG7c57XOjY1LPOWGyHA+0DgIkdkKbk2S54ZvAvNzX7+9L/qEQFSAmHJusZ3bpyEX AdK6Uh+AzGlw8SlSm16afV5luJsyPkGl+wTcEJTb+E2noLIDirskfKtjtKxHZBEjtCsg PG6Owhxl5Fn2UpohZNtMZr1kssKOLmUbzYgW/JwJEHifzaQKrbo/eU/max08NiSE139e qKIDdjMuvH72QsgTVOqLM2HzFdCexfdJ9X3lIyQH9gnCPTduh+3cfexCNFJXom4oLdJS XK+xK/WXJvU5Ebgm+Utvw+dCtn57ibaJ7LckzBb75OxJIEthfst8CVyteWnie3BhTWH5 G94w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k39si11806352edb.52.2019.10.14.01.17.38; Mon, 14 Oct 2019 01:18:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730280AbfJNIPV (ORCPT + 99 others); Mon, 14 Oct 2019 04:15:21 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:57744 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728883AbfJNIPV (ORCPT ); Mon, 14 Oct 2019 04:15:21 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 157D8BF304DC5C62F497; Mon, 14 Oct 2019 16:15:19 +0800 (CST) Received: from [127.0.0.1] (10.177.251.225) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Mon, 14 Oct 2019 16:15:13 +0800 Subject: [PATCH 1/2] perf/ring_buffer: Modify the parameter type of perf_mmap_free_page() From: Yunfeng Ye To: , , , , , , CC: References: <4d308608-54e2-05fa-5a1a-9cb7b4986bd1@huawei.com> Message-ID: Date: Mon, 14 Oct 2019 16:14:59 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <4d308608-54e2-05fa-5a1a-9cb7b4986bd1@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.251.225] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In perf_mmap_free_page(), the unsigned long type is converted to the pointer type, but where the call is made, the pointer type is converted to the unsigned long type. There is no need to do these operations. Modify the parameter type of perf_mmap_free_page() to pointer type. Signed-off-by: Yunfeng Ye --- kernel/events/ring_buffer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c index ffb59a4..abc145c 100644 --- a/kernel/events/ring_buffer.c +++ b/kernel/events/ring_buffer.c @@ -799,9 +799,9 @@ struct ring_buffer *rb_alloc(int nr_pages, long watermark, int cpu, int flags) return NULL; } -static void perf_mmap_free_page(unsigned long addr) +static void perf_mmap_free_page(void *addr) { - struct page *page = virt_to_page((void *)addr); + struct page *page = virt_to_page(addr); page->mapping = NULL; __free_page(page); @@ -811,9 +811,9 @@ void rb_free(struct ring_buffer *rb) { int i; - perf_mmap_free_page((unsigned long)rb->user_page); + perf_mmap_free_page(rb->user_page); for (i = 0; i < rb->nr_pages; i++) - perf_mmap_free_page((unsigned long)rb->data_pages[i]); + perf_mmap_free_page(rb->data_pages[i]); kfree(rb); } -- 2.7.4