Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14094085ybl; Mon, 30 Dec 2019 04:02:25 -0800 (PST) X-Google-Smtp-Source: APXvYqyJeFXXfQwqgyHyWWWSwUVKbxqml9pkj0pTjtyMn3aZC4V3FijKiP0CtgIru2dcyjnsKYX1 X-Received: by 2002:a05:6830:10c6:: with SMTP id z6mr78210584oto.203.1577707345001; Mon, 30 Dec 2019 04:02:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577707344; cv=none; d=google.com; s=arc-20160816; b=kD8Eps6TTKAMqi1vSuChzQBSilvlcdNJ648YxOuPEHkSsdP+nFrjrh97Jw4VtNrdfX 1KMUZLEgkce7T6lziWXqxzr6jpbC3Yn7oIKixCIFoWldGIrzTkH5/hZXycEngfnCoFW0 E1HW1JKKTK0fDgzT4Q6WngenR4gIbDAtf+vEnNSUr2R2SH6TM0GSxNE+w+4d85JJCrVr 8XzKUYSl1+HE50I9HeuvoGDgx9z1oilcU6yFE7O8XkPEmA3VcF0pxQR4zGPmmFu3FeE4 z7J+J8pJGtzxW/RR/hdU782gccR19DWlG86Rip3osXUMjJSTH8MPbvuKidoOgunb9S4V xDDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=ynqdFNbzJjZnp1TJCqQ+UCRuPzOr3pKJGr6fC6LDoxA=; b=Tk0ibQ3SJELxM7hOd6DdIb6mNnDkrG4C5VgFezRnAayUVzQH95L/y6I6/Y2CMLBccS XzvRw8vB2xAYCSkQwfPJbjSg6/NbnCW/vnRWuSzWnMs2zWbJbj4tKTt2jagT1sW72V1m y8Po41m+lLlPjF16dXkuPBb0M2ffhd47YTpCaRrPhAjx6pKlwOst/uRjqNaQOJPXfhRt 6xMZKMjcIWzHC2lh2da4dbzPivJ0feEcXvxxlSZMRle+htvT3ceDl7tsMw93nB75U7Si pYahP9saZAPgS60TOMdC1ySZW3I6p2gnBPtrV4lInsAJ/kxdPeZT6IJufgU/hQdjkVpF VxRg== 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 r1si21486107otk.251.2019.12.30.04.02.13; Mon, 30 Dec 2019 04:02:24 -0800 (PST) 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 S1727473AbfL3MBP (ORCPT + 99 others); Mon, 30 Dec 2019 07:01:15 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:46638 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726196AbfL3MBP (ORCPT ); Mon, 30 Dec 2019 07:01:15 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 851AD5C8891C7BB89C4D; Mon, 30 Dec 2019 20:01:12 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Mon, 30 Dec 2019 20:01:05 +0800 From: Xiongfeng Wang To: , CC: , , , , , Subject: [PATCH v2] ACPI/PPTT: fixed some parameter type is not right Date: Mon, 30 Dec 2019 19:56:28 +0800 Message-ID: <1577706988-56848-1-git-send-email-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tian Tao The fourth parameter 'level' of function 'acpi_find_cache_level()' is a signed interger, but its caller 'acpi_find_cache_node()' passes that parameter an unsigned interger. This patch fixes the paramter type inconsistency. Signed-off-by: Tian Tao Signed-off-by: Xiongfeng Wang --- v2: fix the conflicts in the third hunk. Modify the commit information a little bit. --- drivers/acpi/pptt.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c index f31544d..4ae9335 100644 --- a/drivers/acpi/pptt.c +++ b/drivers/acpi/pptt.c @@ -98,11 +98,11 @@ static inline bool acpi_pptt_match_type(int table_type, int type) * * Return: The cache structure and the level we terminated with. */ -static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr, - int local_level, - struct acpi_subtable_header *res, - struct acpi_pptt_cache **found, - int level, int type) +static unsigned int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr, + unsigned int local_level, + struct acpi_subtable_header *res, + struct acpi_pptt_cache **found, + unsigned int level, int type) { struct acpi_pptt_cache *cache; @@ -119,7 +119,7 @@ static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr, if (*found != NULL && cache != *found) pr_warn("Found duplicate cache level/type unable to determine uniqueness\n"); - pr_debug("Found cache @ level %d\n", level); + pr_debug("Found cache @ level %u\n", level); *found = cache; /* * continue looking at this node's resource list @@ -132,16 +132,17 @@ static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr, return local_level; } -static struct acpi_pptt_cache *acpi_find_cache_level(struct acpi_table_header *table_hdr, - struct acpi_pptt_processor *cpu_node, - int *starting_level, int level, - int type) +static struct acpi_pptt_cache * +acpi_find_cache_level(struct acpi_table_header *table_hdr, + struct acpi_pptt_processor *cpu_node, + unsigned int *starting_level, unsigned int level, + int type) { struct acpi_subtable_header *res; - int number_of_levels = *starting_level; + unsigned int number_of_levels = *starting_level; int resource = 0; struct acpi_pptt_cache *ret = NULL; - int local_level; + unsigned int local_level; /* walk down from processor node */ while ((res = acpi_get_pptt_resource(table_hdr, cpu_node, resource))) { @@ -321,12 +322,12 @@ static struct acpi_pptt_cache *acpi_find_cache_node(struct acpi_table_header *ta unsigned int level, struct acpi_pptt_processor **node) { - int total_levels = 0; + unsigned int total_levels = 0; struct acpi_pptt_cache *found = NULL; struct acpi_pptt_processor *cpu_node; u8 acpi_type = acpi_cache_type(type); - pr_debug("Looking for CPU %d's level %d cache type %d\n", + pr_debug("Looking for CPU %d's level %u cache type %d\n", acpi_cpu_id, level, acpi_type); cpu_node = acpi_find_processor_node(table_hdr, acpi_cpu_id); -- 1.7.12.4