summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2020-04-23 13:48:13 -0700
committerCommit Bot <commit-bot@chromium.org>2020-04-26 00:15:38 +0000
commitf75810f7ffcdef9f7c7bd5ebc6f238ad900bccc5 (patch)
tree184cb85b8984f9a1f0d298fbdfb9313f1c9146e0
parente1952dd7d40fe45804cedcafc43c87a5d064b0c5 (diff)
downloadcrosvm-f75810f7ffcdef9f7c7bd5ebc6f238ad900bccc5.tar
crosvm-f75810f7ffcdef9f7c7bd5ebc6f238ad900bccc5.tar.gz
crosvm-f75810f7ffcdef9f7c7bd5ebc6f238ad900bccc5.tar.bz2
crosvm-f75810f7ffcdef9f7c7bd5ebc6f238ad900bccc5.tar.lz
crosvm-f75810f7ffcdef9f7c7bd5ebc6f238ad900bccc5.tar.xz
crosvm-f75810f7ffcdef9f7c7bd5ebc6f238ad900bccc5.tar.zst
crosvm-f75810f7ffcdef9f7c7bd5ebc6f238ad900bccc5.zip
Remove unnecessary parentheses in consts
Fix clippy "error: unnecessary parentheses around assigned value."

BUG=None
TEST=bin/clippy

Change-Id: I31e61c770c62d7ff2ca8525bf754bd615e24c349
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2163204
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
-rw-r--r--devices/src/virtio/fs/server.rs2
-rw-r--r--devices/src/virtio/gpu/protocol.rs4
-rw-r--r--devices/src/virtio/input/constants.rs14
-rw-r--r--x86_64/src/acpi.rs4
-rw-r--r--x86_64/src/lib.rs4
5 files changed, 14 insertions, 14 deletions
diff --git a/devices/src/virtio/fs/server.rs b/devices/src/virtio/fs/server.rs
index 6774b7b..33b7c98 100644
--- a/devices/src/virtio/fs/server.rs
+++ b/devices/src/virtio/fs/server.rs
@@ -18,7 +18,7 @@ use crate::virtio::fs::fuse::*;
 use crate::virtio::fs::{Error, Result};
 use crate::virtio::{Reader, Writer};
 
-const MAX_BUFFER_SIZE: u32 = (1 << 20);
+const MAX_BUFFER_SIZE: u32 = 1 << 20;
 const DIRENT_PADDING: [u8; 8] = [0; 8];
 
 struct ZCReader<'a>(Reader<'a>);
diff --git a/devices/src/virtio/gpu/protocol.rs b/devices/src/virtio/gpu/protocol.rs
index 3df6975..5605dd3 100644
--- a/devices/src/virtio/gpu/protocol.rs
+++ b/devices/src/virtio/gpu/protocol.rs
@@ -137,7 +137,7 @@ pub fn virtio_gpu_cmd_str(cmd: u32) -> &'static str {
     }
 }
 
-pub const VIRTIO_GPU_FLAG_FENCE: u32 = (1 << 0);
+pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1 << 0;
 
 #[derive(Copy, Clone, Debug, Default)]
 #[repr(C)]
@@ -336,7 +336,7 @@ pub struct virtio_gpu_transfer_host_3d {
 unsafe impl DataInit for virtio_gpu_transfer_host_3d {}
 
 /* VIRTIO_GPU_CMD_RESOURCE_CREATE_3D */
-pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = (1 << 0);
+pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1 << 0;
 #[derive(Copy, Clone, Debug, Default)]
 #[repr(C)]
 pub struct virtio_gpu_resource_create_3d {
diff --git a/devices/src/virtio/input/constants.rs b/devices/src/virtio/input/constants.rs
index 84799b2..7973312 100644
--- a/devices/src/virtio/input/constants.rs
+++ b/devices/src/virtio/input/constants.rs
@@ -12,7 +12,7 @@ pub const INPUT_PROP_POINTING_STICK: u16 = 0x05;
 pub const INPUT_PROP_ACCELEROMETER: u16 = 0x06;
 
 pub const INPUT_PROP_MAX: u16 = 0x1f;
-pub const INPUT_PROP_CNT: u16 = (INPUT_PROP_MAX + 1);
+pub const INPUT_PROP_CNT: u16 = INPUT_PROP_MAX + 1;
 
 pub const EV_SYN: u16 = 0x00;
 pub const EV_KEY: u16 = 0x01;
@@ -638,7 +638,7 @@ pub const BTN_TRIGGER_HAPPY40: u16 = 0x2e7;
 
 pub const KEY_MIN_INTERESTING: u16 = KEY_MUTE;
 pub const KEY_MAX: u16 = 0x2ff;
-pub const KEY_CNT: u16 = (KEY_MAX + 1);
+pub const KEY_CNT: u16 = KEY_MAX + 1;
 
 pub const REL_X: u16 = 0x00;
 pub const REL_Y: u16 = 0x01;
@@ -651,7 +651,7 @@ pub const REL_DIAL: u16 = 0x07;
 pub const REL_WHEEL: u16 = 0x08;
 pub const REL_MISC: u16 = 0x09;
 pub const REL_MAX: u16 = 0x0f;
-pub const REL_CNT: u16 = (REL_MAX + 1);
+pub const REL_CNT: u16 = REL_MAX + 1;
 
 pub const ABS_X: u16 = 0x00;
 pub const ABS_Y: u16 = 0x01;
@@ -699,7 +699,7 @@ pub const ABS_MT_TOOL_X: u16 = 0x3c;
 pub const ABS_MT_TOOL_Y: u16 = 0x3d;
 
 pub const ABS_MAX: u16 = 0x3f;
-pub const ABS_CNT: u16 = (ABS_MAX + 1);
+pub const ABS_CNT: u16 = ABS_MAX + 1;
 
 pub const MSC_SERIAL: u16 = 0x00;
 pub const MSC_PULSELED: u16 = 0x01;
@@ -708,7 +708,7 @@ pub const MSC_RAW: u16 = 0x03;
 pub const MSC_SCAN: u16 = 0x04;
 pub const MSC_TIMESTAMP: u16 = 0x05;
 pub const MSC_MAX: u16 = 0x07;
-pub const MSC_CNT: u16 = (MSC_MAX + 1);
+pub const MSC_CNT: u16 = MSC_MAX + 1;
 
 pub const LED_NUML: u16 = 0x00;
 pub const LED_CAPSL: u16 = 0x01;
@@ -722,12 +722,12 @@ pub const LED_MISC: u16 = 0x08;
 pub const LED_MAIL: u16 = 0x09;
 pub const LED_CHARGING: u16 = 0x0a;
 pub const LED_MAX: u16 = 0x0f;
-pub const LED_CNT: u16 = (LED_MAX + 1);
+pub const LED_CNT: u16 = LED_MAX + 1;
 
 pub const REP_DELAY: u16 = 0x00;
 pub const REP_PERIOD: u16 = 0x01;
 pub const REP_MAX: u16 = 0x01;
-pub const REP_CNT: u16 = (REP_MAX + 1);
+pub const REP_CNT: u16 = REP_MAX + 1;
 
 // Should match linux/virtio_input.h
 pub const VIRTIO_INPUT_CFG_UNSET: u8 = 0x00;
diff --git a/x86_64/src/acpi.rs b/x86_64/src/acpi.rs
index 3600d16..14b21a7 100644
--- a/x86_64/src/acpi.rs
+++ b/x86_64/src/acpi.rs
@@ -40,8 +40,8 @@ const FADT_LEN: u32 = 276;
 const FADT_REVISION: u8 = 6;
 const FADT_MINOR_REVISION: u8 = 3;
 // FADT flags
-const FADT_POWER_BUTTON: u32 = (1 << 4);
-const FADT_SLEEP_BUTTON: u32 = (1 << 5);
+const FADT_POWER_BUTTON: u32 = 1 << 4;
+const FADT_SLEEP_BUTTON: u32 = 1 << 5;
 // FADT fields offset
 const FADT_FIELD_SCI_INTERRUPT: usize = 46;
 const FADT_FIELD_PM1A_EVENT_BLK_ADDR: usize = 56;
diff --git a/x86_64/src/lib.rs b/x86_64/src/lib.rs
index 95f7835..2e54998 100644
--- a/x86_64/src/lib.rs
+++ b/x86_64/src/lib.rs
@@ -177,8 +177,8 @@ pub struct X8664arch;
 
 const BOOT_STACK_POINTER: u64 = 0x8000;
 // Make sure it align to 256MB for MTRR convenient
-const MEM_32BIT_GAP_SIZE: u64 = (768 << 20);
-const FIRST_ADDR_PAST_32BITS: u64 = (1 << 32);
+const MEM_32BIT_GAP_SIZE: u64 = 768 << 20;
+const FIRST_ADDR_PAST_32BITS: u64 = 1 << 32;
 const END_ADDR_BEFORE_32BITS: u64 = FIRST_ADDR_PAST_32BITS - MEM_32BIT_GAP_SIZE;
 const MMIO_SIZE: u64 = MEM_32BIT_GAP_SIZE - 0x8000000;
 const KERNEL_64BIT_ENTRY_OFFSET: u64 = 0x200;