Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp229092imm; Tue, 24 Jul 2018 17:52:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpctjY8M0k+XgILW7YSC4PupftzZKbdRMnJwsWH4WUGfHEJOFr+8JWun4XaxumqHoKKPpYTk X-Received: by 2002:a17:902:bb0d:: with SMTP id l13-v6mr4819639pls.5.1532479975237; Tue, 24 Jul 2018 17:52:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532479975; cv=none; d=google.com; s=arc-20160816; b=pdwVz8m9gPmpeM0TfAXWNZ8ZKWErBrSrZtPGzfP2zvy/AwdIs1SgYN26UY3zvJJVHS BiNrt3U7lUQZzdXBVvnCZpXUStka4SVCb+ZXV9pHhw/ebLvnuuz8Kw90DnUiftHfuQgs CPHwQcsA5W65ExLfG1eTOLNU3AMLAiDeFwSFuT54FIaxo8377NjH4I8U9vQ0hCV63XZa Xkt5j4GfsrMVo9i5JB2E4xNGoaYxgj5XvHKAb8KZ+Sdlmg+E4UsNnCtlmSNH0sL/Igko //u5rFHwr//6hs56GTp18P1HEekYRdYhVl8GR0exXVBYrsmTBqZsXUOg7iVrcOxERUkw +n0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references:message-id :in-reply-to:date:mime-version:dkim-signature :arc-authentication-results; bh=ViKdSNtwNvF4IrGWzd1FVPCshvJStAz4kdtAw+u39EM=; b=0pkTvhoSZDsmuJZl3v43xKZao3SfJ+O5A9q/zAX51rNAouKdfrgJUShElryWvaPMmb O5kTikCa1BtqnGesNHvDRsSPG0+vxx4Wu2X2hoE98R7uFmQN0SmA/qFZPN1O4Q1ZEsGk saARw4X8PqNLtgr7bMvogJcpKKp2HTYcqJtulWHv2KX/whpIejEP3xHNGBoO7wwdbShT gR+FaMGDJ96xMQmdXZsjr2F/X2L7KUNOO6H+ySKYh0zF7/abK79y3sz8qqE7JRaOB7hj CPdCWIu6IWUWOPs4Qg/kauW1HHemsmQz+JTrulsvrCzXMyKtai67KGDBYSD4yIT5bZky MDZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=M83IDU4E; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13-v6si12569014pgh.642.2018.07.24.17.52.40; Tue, 24 Jul 2018 17:52:55 -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=@google.com header.s=20161025 header.b=M83IDU4E; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388525AbeGYCAy (ORCPT + 99 others); Tue, 24 Jul 2018 22:00:54 -0400 Received: from mail-qt0-f202.google.com ([209.85.216.202]:40387 "EHLO mail-qt0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388420AbeGYCAy (ORCPT ); Tue, 24 Jul 2018 22:00:54 -0400 Received: by mail-qt0-f202.google.com with SMTP id 13-v6so4660395qtt.7 for ; Tue, 24 Jul 2018 17:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:date:in-reply-to:message-id:references:subject:from:to :cc; bh=ViKdSNtwNvF4IrGWzd1FVPCshvJStAz4kdtAw+u39EM=; b=M83IDU4EH22kMToY93S7bV1Dwaiec2hGZml87+qgKLKPKhqj5WVE0F39f1SbCbJK36 9yBNZGNAca0kU4TXR/kyhjjqgxN+HdVowf7dY/GVtuIvKidmlc1WRakQhkLcjXCmgqlU cbfimP7lZhwWgvV02ggPatPETKnp7017Q/Ta+0UO8CvpE656CuTYP09Tgqv5laoCdVO8 uy1nAoHs3sWPQTQOlb5QONn0Qc7UviGeM5Yccek8uaPXpZos+EsK2Qj8ilE/ggaFQE86 vBcoOEnNZ5tp8r1k5OK7+5YGIc1Re4dm1jICIUVZ9/cMsz3Nhkx4gNJ9TrrigZPiW4C3 Fibg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:in-reply-to:message-id :references:subject:from:to:cc; bh=ViKdSNtwNvF4IrGWzd1FVPCshvJStAz4kdtAw+u39EM=; b=V38bpD4jn0n6WZFaGSO2K+AVcDbJqGElaBi9lirKIka5V043RkEG3bmScpme6ef/y4 fGWrNprVl9qyi0kGbRsw1UNDmHYfPNderREbdJBBdGeF6WxXu3u8s0KC7BDmErj4xYFw 3bIhg+hpnhVSiE4Ndg3CTakSEr9v2wjJcJdQ6Ikp1JHd+8z2aMylHkwZuKGt0nfw8kBz S7+X1Jzh9R1cuWVY7cuWTobxchB3s3HeIW0UWRrmXIimCdbCN3AxsDQ6soqYMZoSv2VY q6mLR/7w9S2u6F57g9CN4BS9Dv3TFeFyqrOFktRlya8Tvon87l5EZLxwlF5dxG+v7f7w x4IQ== X-Gm-Message-State: AOUpUlFEHHgomd3OI1fZcnenhZ86MwAGZ9JA8vsvlSOYxmSrUxp1cD1p xEz7YBMQ9hbMN6E3ff0lyolNY7iF MIME-Version: 1.0 X-Received: by 2002:a0c:be06:: with SMTP id k6-v6mr10384613qvg.56.1532479908967; Tue, 24 Jul 2018 17:51:48 -0700 (PDT) Date: Tue, 24 Jul 2018 17:51:32 -0700 In-Reply-To: <20180725005133.107823-1-rkir@google.com> Message-Id: <20180725005133.107823-2-rkir@google.com> References: <20180725005133.107823-1-rkir@google.com> X-Mailer: git-send-email 2.18.0.233.g985f88cf7e-goog Subject: [PATCH v2 2/3] tty: Make constants to be enums instead of #define in goldfish.c From: rkir@google.com To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Roman Kiryanov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roman Kiryanov enums produce better compilation errors than defines. Signed-off-by: Roman Kiryanov --- Changes in v2: - Added the enum types (goldfish_tty_reg and goldfish_tty_cmd). drivers/tty/goldfish.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c index a92fcb2b0002..173383f2a4c1 100644 --- a/drivers/tty/goldfish.c +++ b/drivers/tty/goldfish.c @@ -19,18 +19,22 @@ #include /* Goldfish tty register's offsets */ -#define GOLDFISH_TTY_REG_BYTES_READY 0x04 -#define GOLDFISH_TTY_REG_CMD 0x08 -#define GOLDFISH_TTY_REG_DATA_PTR 0x10 -#define GOLDFISH_TTY_REG_DATA_LEN 0x14 -#define GOLDFISH_TTY_REG_DATA_PTR_HIGH 0x18 -#define GOLDFISH_TTY_REG_VERSION 0x20 +enum goldfish_tty_reg { + GOLDFISH_TTY_REG_BYTES_READY = 0x04, + GOLDFISH_TTY_REG_CMD = 0x08, + GOLDFISH_TTY_REG_DATA_PTR = 0x10, + GOLDFISH_TTY_REG_DATA_LEN = 0x14, + GOLDFISH_TTY_REG_DATA_PTR_HIGH = 0x18, + GOLDFISH_TTY_REG_VERSION = 0x20, +}; /* Goldfish tty commands */ -#define GOLDFISH_TTY_CMD_INT_DISABLE 0 -#define GOLDFISH_TTY_CMD_INT_ENABLE 1 -#define GOLDFISH_TTY_CMD_WRITE_BUFFER 2 -#define GOLDFISH_TTY_CMD_READ_BUFFER 3 +enum goldfish_tty_cmd { + GOLDFISH_TTY_CMD_INT_DISABLE = 0, + GOLDFISH_TTY_CMD_INT_ENABLE = 1, + GOLDFISH_TTY_CMD_WRITE_BUFFER = 2, + GOLDFISH_TTY_CMD_READ_BUFFER = 3, +}; struct goldfish_tty { struct tty_port port; -- 2.18.0.233.g985f88cf7e-goog