Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752530AbbLIVmT (ORCPT ); Wed, 9 Dec 2015 16:42:19 -0500 Received: from mail-vk0-f43.google.com ([209.85.213.43]:34386 "EHLO mail-vk0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751960AbbLIVmR (ORCPT ); Wed, 9 Dec 2015 16:42:17 -0500 MIME-Version: 1.0 In-Reply-To: <20151209085005.GR11966@pengutronix.de> References: <1449610162-30543-1-git-send-email-john.stultz@linaro.org> <1858873.xsM5XHIlTX@wuerfel> <20151209085005.GR11966@pengutronix.de> Date: Wed, 9 Dec 2015 13:42:16 -0800 Message-ID: Subject: Re: [RFC][PATCH] misc: Introduce reboot_reason driver From: John Stultz To: Sascha Hauer Cc: Arnd Bergmann , lkml , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Vinay Simha BN , Bjorn Andersson , Haojian Zhuang , devicetree@vger.kernel.org, Android Kernel Team 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: 1136 Lines: 32 On Wed, Dec 9, 2015 at 12:50 AM, Sascha Hauer wrote: > On Tue, Dec 08, 2015 at 04:13:35PM -0800, John Stultz wrote: >> >> Is there a better way? Are enums for array indexes out of fashion? > > They are not, but you have declared a variable (reason_types) which you > don't use. You probably meant to create a enum named reason_types, like > this: > > enum reason_types { > NONE, > BOOTLOADER, > RECOVERY, > OEM, > MAX_REASONS > }; So I had tried using a enum name as well, close to what you suggest here, and still got the "warning: useless storage class specifier in empty declaration" build warning. Though trying again, it seems the problem was I was declaring it as "static enum ...". Removing the static allows it to build w/o warnings as a unnamed enum structure. Why, I don't know. :P Thanks for the pointer! -john -- 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/