Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3354047ybe; Sun, 15 Sep 2019 13:25:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXiaUSoSecrLgEF6m9oWuHcGj/keS2/GokHOArJIXbNnnQVLI2XbKoTQYl/c1GUbCgkvh9 X-Received: by 2002:a50:a57d:: with SMTP id z58mr3496211edb.115.1568579159525; Sun, 15 Sep 2019 13:25:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568579159; cv=none; d=google.com; s=arc-20160816; b=VvZVh6LVeLZUdJ9fIQvz8sobW45cXjFq8AST/8U8WPsHaaeNLgoSA3PxUAtLs+GoMx E0hi6Be5VkS8ICO6KCvALp4c3ndHVJ7po7q8QfJtZvUnLbSyLTPkGeEWVDs0Iayuebs5 m8TZIwRoS6e+U3mwF+wFy56lhB4cT9D66h0W50cfoC4fZAL4I3g8PKO2dwjQdSswbYT0 sOui96FFKc/UqPVRUw1TBiGSlmTkBY7qY3X/TYCBxAm00VuN2Kn3e/Gh6knCUxJjQ7ud 0RKVstRWXySRo+SSXcltL0zty8GkcYxkE6dv9UJVbccBFWT/YzmQ/TkQjffWauzPrZeN 5RhQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=X86RdWoaDKqJbFDIoXti2bda7+kkyeUkiLhSN5JzlKU=; b=W3eSkours4edSDALyqNrinoCjc0WnnRnUW3a7M0hsQuzwNjVWYwYOdl0knhVv35WFf Uzm8YFgYl56+ySXQZiXZa6d09akQt9b+eWdDClFbBRCh0sDtC3iBjYAL0EOU7UehPUpJ cTxE7h/bdFSt0SR46SiGC8FoA0+cpxKtZbjz4VIdAUsVV8H9TVzPoIzpnw2OGxwhotX6 LSMopjKA3z0e+OnFYCgkRWRwz+/nM+9zopWNWwuJE95LrhEZusANEyHj4WLkRQO9txQ/ QnpeQ96kbGzo4nsG7ybu5NyIlDRTWam4Yumu+nHvUxpcTPl//uWEokxMbzLs2LcxVCrx oVZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SJ4lQn8Y; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4si19555993edy.227.2019.09.15.13.25.36; Sun, 15 Sep 2019 13:25:59 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SJ4lQn8Y; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727334AbfIORIt (ORCPT + 99 others); Sun, 15 Sep 2019 13:08:49 -0400 Received: from mail-pg1-f182.google.com ([209.85.215.182]:44481 "EHLO mail-pg1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbfIORIs (ORCPT ); Sun, 15 Sep 2019 13:08:48 -0400 Received: by mail-pg1-f182.google.com with SMTP id i18so18026749pgl.11 for ; Sun, 15 Sep 2019 10:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X86RdWoaDKqJbFDIoXti2bda7+kkyeUkiLhSN5JzlKU=; b=SJ4lQn8Y/Rod0i0hqNjNSitEVvQrs8es0QonZHsDCnKam7BbbzVEPHy9+oxknfPvN8 etneVvl++kTLOnVbyVL3J27f0y0RDkparH82n0CA0OHumA+LjRYK2Xd4Pn/Cwf6pUd9U pWOGQXYTwqx9bx6SmhPsjzugvSCmqq5EyYXooQeib3Gteu+s8MoQwXuXqJ5dapDppK4E ZEexxMNhYSAcJb5SZhCeLI6aUGaioUwvuSx4bHo6vu8Coi81LXYgcIR+bUAQhjmReZFM XxJsBsaBFvMm90tPLA7Yp3Vfz2paaHQs3L/5VMESJcuchf5AGuhYYtmwx7Up5u5AH4CE dikg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=X86RdWoaDKqJbFDIoXti2bda7+kkyeUkiLhSN5JzlKU=; b=KEDxqPQzvTTupQe8m/8fcGZEg8KsVUPVt7w1pv3RDJt1JpX7UQIsaOqpzst+UT/q3h nVKcLRKnfn6kktA//PAYDHSgO6Q8bg8+MO82W1USg3gOXyQZJjnUBTDZsDZgk7Xpt3FL l1OZ0fcUc9M/ZP6cs7h7oJIr8chfUmdO9wiQl/E406jSIouzkXk0/3HUoMWJuFG2ObiV YjO6erIUsEUWxaTsYU0ZR9Q1L/vagaKJazHAdGKdRgoj9iSt52yqKJKMSgEEaddqYTN1 EYBimFsMca4fNjUUcydfC+1+tr6jEXMByC6E8YiritbsneH9Txv+OPtTHXHsXxHgfyq3 cYZw== X-Gm-Message-State: APjAAAXJFg5j8DSCKDMUzQAP9CQ3QWecDLIruZ3N/MV089dYkaZ+mjeH DsZ8Mckein7aTREhqJU5BHY= X-Received: by 2002:a17:90a:8901:: with SMTP id u1mr2904510pjn.70.1568567327646; Sun, 15 Sep 2019 10:08:47 -0700 (PDT) Received: from localhost.localdomain.localdomain ([2408:823c:c11:160:b8c3:8577:bf2f:3]) by smtp.gmail.com with ESMTPSA id r28sm62279134pfg.62.2019.09.15.10.08.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Sep 2019 10:08:47 -0700 (PDT) From: Pengfei Li To: akpm@linux-foundation.org Cc: vbabka@suse.cz, cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, guro@fb.com, Pengfei Li Subject: [RESEND v4 3/7] mm, slab_common: Use enum kmalloc_cache_type to iterate over kmalloc caches Date: Mon, 16 Sep 2019 01:08:05 +0800 Message-Id: <20190915170809.10702-4-lpf.vector@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190915170809.10702-1-lpf.vector@gmail.com> References: <20190915170809.10702-1-lpf.vector@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The type of local variable *type* of new_kmalloc_cache() should be enum kmalloc_cache_type instead of int, so correct it. Signed-off-by: Pengfei Li Acked-by: Vlastimil Babka Acked-by: Roman Gushchin --- mm/slab_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/slab_common.c b/mm/slab_common.c index 8b542cfcc4f2..af45b5278fdc 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -1192,7 +1192,7 @@ void __init setup_kmalloc_cache_index_table(void) } static void __init -new_kmalloc_cache(int idx, int type, slab_flags_t flags) +new_kmalloc_cache(int idx, enum kmalloc_cache_type type, slab_flags_t flags) { if (type == KMALLOC_RECLAIM) flags |= SLAB_RECLAIM_ACCOUNT; @@ -1210,7 +1210,8 @@ new_kmalloc_cache(int idx, int type, slab_flags_t flags) */ void __init create_kmalloc_caches(slab_flags_t flags) { - int i, type; + int i; + enum kmalloc_cache_type type; for (type = KMALLOC_NORMAL; type <= KMALLOC_RECLAIM; type++) { for (i = KMALLOC_SHIFT_LOW; i <= KMALLOC_SHIFT_HIGH; i++) { -- 2.21.0