From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 7F1001BFBC3 for ; Tue, 18 Apr 2017 00:36:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 73B6F89F2B for ; Tue, 18 Apr 2017 00:36:00 +0000 (UTC) Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vXjxqK5gYIjW for ; Tue, 18 Apr 2017 00:35:59 +0000 (UTC) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by hemlock.osuosl.org (Postfix) with ESMTPS id 6359D89F2D for ; Tue, 18 Apr 2017 00:35:59 +0000 (UTC) From: "Tobin C. Harding" Subject: [PATCH 02/15] staging: ks7010: replace defines with enum types Date: Tue, 18 Apr 2017 10:35:30 +1000 Message-Id: <1492475743-25189-3-git-send-email-me@tobin.cc> In-Reply-To: <1492475743-25189-1-git-send-email-me@tobin.cc> References: <1492475743-25189-1-git-send-email-me@tobin.cc> List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Greg Kroah-Hartman Cc: Wolfram Sang , driverdev-devel@linuxdriverproject.org Header has multiple constants defined using preprocessor directive. In the cases where these are an integer progression an enumeration type can be used. Doing so adds documentation to the code and makes the usage explicit. Maintain original constant value, this value is returned by the device. Replace (integer progression) preprocessor constants with enumeration type. Signed-off-by: Tobin C. Harding --- drivers/staging/ks7010/ks7010_sdio.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.h b/drivers/staging/ks7010/ks7010_sdio.h index 0b8b865..e9b0ad9 100644 --- a/drivers/staging/ks7010/ks7010_sdio.h +++ b/drivers/staging/ks7010/ks7010_sdio.h @@ -62,14 +62,18 @@ enum reg_status_type { /* General Communication Register A */ #define GCR_A 0x000028 -#define GCR_A_INIT 0 -#define GCR_A_REMAP 1 -#define GCR_A_RUN 2 +enum gen_com_reg_a { + GCR_A_INIT, + GCR_A_REMAP, + GCR_A_RUN +}; /* General Communication Register B */ #define GCR_B 0x00002C -#define GCR_B_ACTIVE 0 -#define GCR_B_DOZE 1 +enum gen_com_reg_b { + GCR_B_ACTIVE, + GCR_B_DOZE +}; /* Wakeup Register */ /* #define WAKEUP 0x008104 */ -- 2.7.4 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel