Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp209288imm; Tue, 17 Jul 2018 17:16:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcjnhZt8Jm/qPhwEdf6vJ/fnY4OWv7XCfNop1IyK8UYNQT1PDr8q7rqCcjvnEvI7C0Jrzzs X-Received: by 2002:a63:e742:: with SMTP id j2-v6mr3590014pgk.114.1531873005110; Tue, 17 Jul 2018 17:16:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531873005; cv=none; d=google.com; s=arc-20160816; b=u5CoWtKDr9XxQHbgcEikqFUXh1ArSkqzqfFJOWOdIlwn1NLtQ28PqotwlOQfn+anwJ jNB/mNBMdOkEyE03TkJGfVFbj20Uy2rWEV6jjpVdYZu2WYaiidT/+Yk170frL3YE2zz0 B30bxIgH/pQzzg4GqTXwXWhPY400ZYNPU8k4eHE7d7On6xj4eOGom0dR8J7S3rOWdXHt uZmhxEKX+CAc4ZmV0UXfjGpnE9c6H9xh7RmHzRVBd+9Bc8kyofUsp3tlsPp6WlFMV6RI 3V7IBCsTPHOYE8mN61gWq1ChDcXvehbSv4+EL0UQLzmyQgSUVQupRa/OoislPvxNUD27 mqSg== 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=UTmkHL+5aM285pQIvp81isppzJHzNX0+TeHPxZbDcO0=; b=OzOl/FzGZtQh65j+ZVjV9HKNAaZ9jGshOppkd8XqpW/VnYvZdhoH/hIb1kFUAVAk4t w+2iTUkjEoU8THzp5C4drRngSR9tnJLUQkjmSsaEv8VBjgRAfMWtrhPC3kD9apW8BdA2 OSKENBAKFSWzNU5LUc+/p4hSgXb3AnZ40pzY71Nth/9XCEsy0WM7j7dDWE+23igeK+4r 3yWWAQzHo+MrTmHFXWDoueD1r6kYPGOD+1mIPVzWBN0oQLClIh3uL/GoKIxIrXJ8qmPe t5D84wUm/HIx+iy4imdG4iPLgbFVjYFsXdJLLeg7iJ6uWMRqDFkeiRyK8ynQRdBZdqbn vI0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=m0X7Nysq; 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 i4-v6si1995561pgl.435.2018.07.17.17.16.30; Tue, 17 Jul 2018 17:16:45 -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=m0X7Nysq; 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 S1731485AbeGRAu6 (ORCPT + 99 others); Tue, 17 Jul 2018 20:50:58 -0400 Received: from mail-io0-f201.google.com ([209.85.223.201]:39546 "EHLO mail-io0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730063AbeGRAu6 (ORCPT ); Tue, 17 Jul 2018 20:50:58 -0400 Received: by mail-io0-f201.google.com with SMTP id x5-v6so2136775ioa.6 for ; Tue, 17 Jul 2018 17:15:52 -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=UTmkHL+5aM285pQIvp81isppzJHzNX0+TeHPxZbDcO0=; b=m0X7NysqTdxY7Wok9UZ42bzBK1jCUpabH/1KDd6Shwvtm9Mu8hlnG1OQZJaQBwG0S9 cY0ivv53rev7BTwXe/yL4caTGYrujtAxZ72ZfRFy+dTrma8XVVdydl9Vh6uI42ALW8D/ HfYtIW9N+Tt2wg5/VrYCeIvVJe8kncwI3amIe143O5GkHVHDakAaOpHLjS6pljW5W+L/ 2MXo95PRU3Hv+Jqx2M3V07x9c/Br6onaVMi9x+lzofjhkcjkujv8z6mkAs5vjfaUOIs8 ozEmFjBFZlt6n68x3mCVyLycikokQR4+ZT88tWuqXlnGtwU7F9zPEdE4fA7hl16aGy15 ToOw== 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=UTmkHL+5aM285pQIvp81isppzJHzNX0+TeHPxZbDcO0=; b=aZG3lr3fW3N4bglvqmJaA8882sAM0s89Zf3zr0bATJwizUp58bbJPspx9C1hwpPaWu kBH7mMeuQhwYBymdQJVRABs8uNQbc1wm2TAqsTpB88XhL9bHWsV9TumdvubFA3Ldi0B5 fXMxhKDQJ3Jb43UXFGOQr/GQO8+UPAPYG3GlllIOhPcLsKrqDClIV2iUnCv1aDSm2ANn mKexofo+kIqGQaHIGgSXIXJySFubB8zFXwIerHtVF52rQxIZQXG4RRQc/9pOMVya8G3v 71ogZv7uVf7d6EPnCWmuXeSVtWjFm2+OMVlLQ3Jdj/LjsWNTS6tdqUWLrpH6lVh7gpYj X46w== X-Gm-Message-State: AOUpUlFmSEsfDC032rZxwD+m3iJs558CQ6QHRS+0C3KfCAK4Zexn7Vr/ 7873Ps77mE4lShmMmNVAzVzCdyos MIME-Version: 1.0 X-Received: by 2002:a24:b14a:: with SMTP id c10-v6mr121148itj.4.1531872952437; Tue, 17 Jul 2018 17:15:52 -0700 (PDT) Date: Tue, 17 Jul 2018 17:14:54 -0700 In-Reply-To: <20180718001455.140575-1-rkir@google.com> Message-Id: <20180718001455.140575-2-rkir@google.com> References: <20180718001455.140575-1-rkir@google.com> X-Mailer: git-send-email 2.18.0.203.gfac676dfb9-goog Subject: [PATCH 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, tkjos@google.com, 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 --- 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..a9c8ab8a4750 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_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_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.203.gfac676dfb9-goog