Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751917AbcCID6R (ORCPT ); Tue, 8 Mar 2016 22:58:17 -0500 Received: from mail113-248.mail.alibaba.com ([205.204.113.248]:43409 "EHLO us-alimail-mta2.hst.scl.en.alidc.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750867AbcCID6C convert rfc822-to-8bit (ORCPT ); Tue, 8 Mar 2016 22:58:02 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R451e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03310;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_----4au2X7r_1457495821; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Michal Hocko'" , "'Andrew Morton'" Cc: "'Hugh Dickins'" , "'Sergey Senozhatsky'" , "'Vlastimil Babka'" , "'Linus Torvalds'" , "'Johannes Weiner'" , "'Mel Gorman'" , "'David Rientjes'" , "'Tetsuo Handa'" , "'KAMEZAWA Hiroyuki'" , "'Joonsoo Kim'" , , "'LKML'" , "'Michal Hocko'" References: <20160307160838.GB5028@dhcp22.suse.cz> <1457444565-10524-1-git-send-email-mhocko@kernel.org> <1457444565-10524-3-git-send-email-mhocko@kernel.org> In-Reply-To: <1457444565-10524-3-git-send-email-mhocko@kernel.org> Subject: Re: [PATCH 2/3] mm, compaction: cover all compaction mode in compact_zone Date: Wed, 09 Mar 2016 11:57:00 +0800 Message-ID: <059f01d179b7$bc811fd0$35835f70$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQEsJDv3+1FHnSADFR0H56kaUO0LAQKbhTV4Aup4+jWgbvaaQA== Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1088 Lines: 24 > > From: Michal Hocko > > the compiler is complaining after "mm, compaction: change COMPACT_ > constants into enum" > > mm/compaction.c: In function ‘compact_zone’: > mm/compaction.c:1350:2: warning: enumeration value ‘COMPACT_DEFERRED’ not handled in switch [-Wswitch] > switch (ret) { > ^ > mm/compaction.c:1350:2: warning: enumeration value ‘COMPACT_COMPLETE’ not handled in switch [-Wswitch] > mm/compaction.c:1350:2: warning: enumeration value ‘COMPACT_NO_SUITABLE_PAGE’ not handled in switch [-Wswitch] > mm/compaction.c:1350:2: warning: enumeration value ‘COMPACT_NOT_SUITABLE_ZONE’ not handled in switch [-Wswitch] > mm/compaction.c:1350:2: warning: enumeration value ‘COMPACT_CONTENDED’ not handled in switch [-Wswitch] > > compaction_suitable is allowed to return only COMPACT_PARTIAL, > COMPACT_SKIPPED and COMPACT_CONTINUE so other cases are simply > impossible. Put a VM_BUG_ON to catch an impossible return value. > > Signed-off-by: Michal Hocko > --- Acked-by: Hillf Danton