Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3210431ybe; Sun, 15 Sep 2019 09:59:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxM86W+OU7uk4Tsh2Tn6xi8NEwB/vTWlb93WS8CgXpSvDIc3ydhfe4nt2A+nirVQko+E/OT X-Received: by 2002:a17:906:1385:: with SMTP id f5mr48928865ejc.145.1568566765913; Sun, 15 Sep 2019 09:59:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568566765; cv=none; d=google.com; s=arc-20160816; b=LYV3EiDWkwvGxUahMH3FxFp1m4XrEfoV2Ru4kBy7639FECTEByqmiWpRW+TES0Zn+R GCLjvYPtX03PncuwoE36bHD1IjwsxyCbz7J5NG7791iWCw597geMWnPd8iQArqZ2A0s+ jA+oNDXPsZFhhFLRtO0R+l+loR3riNGkpkGPq4IroAFIIJW/ir1ZBN7t/XgeyMk5XUmp GU7egWcZ6exbS3sqThjxgwmIOGrtpI5t9vesKV9ixb3rKYAVUZ9dR/dliVm9/gjBeZhl 6wFDEfDMlFBOSTWf8W2fo52j08OhsUdiYJ3lBAJ3tqSOwItZZN86HjQxwiyF1O7a7QF7 +VVA== 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=N+zjZafB+EHmzmiSQ3XXjR9YYKwFhGvgcL0xL79tqmHZpqgGcN6U1terzItfrCZNyn ZX7CfNxR3QLml2+K6nGG6UeKiTIJHhIcejQaK2icI5cxCjHKtWLwVo+d+oPlTWmG10g/ 3fTrDd2Fwz2hnOg6oEbIY9ANtCVT3as8thEB+aTp6T4TpYmmry7zk2/J3CixU9RmV4E1 dGbmaB+aRhF2lLi7BC99RhaF3Ec47IjSD+gucSrVO8hNcwofELJqwoS836stD+Y2sT4Y Wu0OWGF3tEz2+uN8hQfjzibzlPYx80ndhBY09VjrXD5L3TidGjoZEdWI0ZvNryleU830 2avA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UVlqUskF; 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 n6si3271994eju.100.2019.09.15.09.59.02; Sun, 15 Sep 2019 09:59:25 -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=UVlqUskF; 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 S1726421AbfIOQwa (ORCPT + 99 others); Sun, 15 Sep 2019 12:52:30 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33264 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726372AbfIOQw3 (ORCPT ); Sun, 15 Sep 2019 12:52:29 -0400 Received: by mail-pf1-f196.google.com with SMTP id q10so21122232pfl.0 for ; Sun, 15 Sep 2019 09:52:29 -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=UVlqUskFF6lnSRhNIDONapUfjNYD1Nk3plqN/bZfrOxvI8jXvH2brUc3nFqa8l6/m2 bzJoXmb99FvFIz8wmkMhFV8OrapnQW+3rgFRcQi84Q0rv0sEXDlzjG35LkxFo4BzBimx E/DEAi8w4LF2wNQ9W3KGhbSNq5T9370tn/2S3iEdZ31+bKcaRwRryklJJW1LxakGJwP2 hmryWpIP5WkJwKDqp2xJL8DpIbGmxZLsRXNr1cJQReJNW2y3Wzy84f0UJnpanyBiaQKz HkHjvIcUU5OcKS+Dn6CCbRB2JjmXiiti8WZT7vWc8yYfL/iWgQMPtA78P41UWqUpkpGY eHqg== 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=KAhcYDBoHnH5QxAsw94bbRa7hh93Ym3AFL++sAwZkPPZygzZLwhcfPg3lkXASHMAtT RZn1AZVTACrQ5OdBylS1nurIzLAiPlRfO0Yk/DbwL8Cq9X8axDuqzKfnTz4dE8xZNdSC nzGKWpWCdV09F3LqWtIzUQEJ8Fsf28NcgwC56lu+9p0DhQCOazSk7iTRI8Il0XfMkC5e 0W+IukWWcO4nHNpSyJEnSQO1C2/iorKyn+2eUpwtazJRt73DOPSpJ3zI32LG8/rINsQh tm9rXV4IETM68Ucw5ZThOlzPt5zKgnk6YhUbMoLc67VTbcRcEvp1XEdc2Qwql1H81rNF piyA== X-Gm-Message-State: APjAAAWm/IBpv9uYPhsdItslY6hEFsgm9LKrvjLbs0ZdYZVwJmcin7Og g3BosH2KMZACUpHllBjWyGE= X-Received: by 2002:a62:5f83:: with SMTP id t125mr67798974pfb.125.1568566349157; Sun, 15 Sep 2019 09:52:29 -0700 (PDT) Received: from localhost.localdomain.localdomain ([2408:823c:c11:160:b8c3:8577:bf2f:3]) by smtp.gmail.com with ESMTPSA id a4sm4383259pgq.6.2019.09.15.09.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Sep 2019 09:52:28 -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: [PATCH v4 3/7] mm, slab_common: Use enum kmalloc_cache_type to iterate over kmalloc caches Date: Mon, 16 Sep 2019 00:51:13 +0800 Message-Id: <20190915165121.7237-5-lpf.vector@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190915165121.7237-1-lpf.vector@gmail.com> References: <20190915165121.7237-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