Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752245AbbEMFo5 (ORCPT ); Wed, 13 May 2015 01:44:57 -0400 Received: from mail-ie0-f170.google.com ([209.85.223.170]:34871 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751639AbbEMFow (ORCPT ); Wed, 13 May 2015 01:44:52 -0400 MIME-Version: 1.0 X-Originating-IP: [5.101.106.105] In-Reply-To: <20150426160909.GC1499@htj.duckdns.org> References: <1429446154-10660-1-git-send-email-cyphar@cyphar.com> <1429446154-10660-2-git-send-email-cyphar@cyphar.com> <20150422152551.GA10738@htj.duckdns.org> <20150422154212.GE3007@worktop.Skamania.guest> <20150422160258.GE10738@htj.duckdns.org> <20150426160909.GC1499@htj.duckdns.org> Date: Wed, 13 May 2015 15:44:51 +1000 Message-ID: Subject: Re: [PATCH v10 1/4] cgroups: use bitmask to filter for_each_subsys From: Aleksa Sarai To: Tejun Heo Cc: lizefan@huawei.com, richard@nod.at, linux-kernel@vger.kernel.org, =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , cgroups@vger.kernel.org, mingo@redhat.com, Peter Zijlstra Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 974 Lines: 27 Hi Tejun, > Hmmmm... You can either convert all masks to ulong (which is fine) or > do something like the following. > > #define for_each_subsys_which(ss_mask, ss, ssid) \ > unsigned long __tmp_mask = (ss_mask); \ > for_each_set_bit(ssid, &__tmp_mask, CGROUP_SUBSYS_COUNT)\ > if ((ss) = group_subsys[ssid] && false) \ > ; \ > else I think I'll just do casting and manually make new variables where required. The above (and similar) doesn't work very well, generates warnings like crazy and breaks stuff like: if (...) for_each_subsys_which(...) -- Aleksa Sarai (cyphar) www.cyphar.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/