瀏覽代碼

src/interpreter.rs: Update clippy linter names (cast_ptr_alignment)

Clippy says the name of the linter is deprecated and should be updated.
Let's update it now.

Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Quentin Monnet 2 年之前
父節點
當前提交
045049e957
共有 1 個文件被更改,包括 10 次插入10 次删除
  1. 10 10
      src/interpreter.rs

+ 10 - 10
src/interpreter.rs

@@ -128,25 +128,25 @@ pub fn execute_program(prog_: Option<&[u8]>, mem: &[u8], mbuff: &[u8], helpers:
 
 
             // BPF_LDX class
             // BPF_LDX class
             ebpf::LD_B_REG   => reg[_dst] = unsafe {
             ebpf::LD_B_REG   => reg[_dst] = unsafe {
-                #[allow(cast_ptr_alignment)]
+                #[allow(clippy::cast_ptr_alignment)]
                 let x = (reg[_src] as *const u8).offset(insn.off as isize) as *const u8;
                 let x = (reg[_src] as *const u8).offset(insn.off as isize) as *const u8;
                 check_mem_load(x as u64, 1, insn_ptr)?;
                 check_mem_load(x as u64, 1, insn_ptr)?;
                 x.read_unaligned() as u64
                 x.read_unaligned() as u64
             },
             },
             ebpf::LD_H_REG   => reg[_dst] = unsafe {
             ebpf::LD_H_REG   => reg[_dst] = unsafe {
-                #[allow(cast_ptr_alignment)]
+                #[allow(clippy::cast_ptr_alignment)]
                 let x = (reg[_src] as *const u8).offset(insn.off as isize) as *const u16;
                 let x = (reg[_src] as *const u8).offset(insn.off as isize) as *const u16;
                 check_mem_load(x as u64, 2, insn_ptr)?;
                 check_mem_load(x as u64, 2, insn_ptr)?;
                 x.read_unaligned() as u64
                 x.read_unaligned() as u64
             },
             },
             ebpf::LD_W_REG   => reg[_dst] = unsafe {
             ebpf::LD_W_REG   => reg[_dst] = unsafe {
-                #[allow(cast_ptr_alignment)]
+                #[allow(clippy::cast_ptr_alignment)]
                 let x = (reg[_src] as *const u8).offset(insn.off as isize) as *const u32;
                 let x = (reg[_src] as *const u8).offset(insn.off as isize) as *const u32;
                 check_mem_load(x as u64, 4, insn_ptr)?;
                 check_mem_load(x as u64, 4, insn_ptr)?;
                 x.read_unaligned() as u64
                 x.read_unaligned() as u64
             },
             },
             ebpf::LD_DW_REG  => reg[_dst] = unsafe {
             ebpf::LD_DW_REG  => reg[_dst] = unsafe {
-                #[allow(cast_ptr_alignment)]
+                #[allow(clippy::cast_ptr_alignment)]
                 let x = (reg[_src] as *const u8).offset(insn.off as isize) as *const u64;
                 let x = (reg[_src] as *const u8).offset(insn.off as isize) as *const u64;
                 check_mem_load(x as u64, 8, insn_ptr)?;
                 check_mem_load(x as u64, 8, insn_ptr)?;
                 x.read_unaligned()
                 x.read_unaligned()
@@ -159,19 +159,19 @@ pub fn execute_program(prog_: Option<&[u8]>, mem: &[u8], mbuff: &[u8], helpers:
                 x.write_unaligned(insn.imm as u8);
                 x.write_unaligned(insn.imm as u8);
             },
             },
             ebpf::ST_H_IMM   => unsafe {
             ebpf::ST_H_IMM   => unsafe {
-                #[allow(cast_ptr_alignment)]
+                #[allow(clippy::cast_ptr_alignment)]
                 let x = (reg[_dst] as *const u8).offset(insn.off as isize) as *mut u16;
                 let x = (reg[_dst] as *const u8).offset(insn.off as isize) as *mut u16;
                 check_mem_store(x as u64, 2, insn_ptr)?;
                 check_mem_store(x as u64, 2, insn_ptr)?;
                 x.write_unaligned(insn.imm as u16);
                 x.write_unaligned(insn.imm as u16);
             },
             },
             ebpf::ST_W_IMM   => unsafe {
             ebpf::ST_W_IMM   => unsafe {
-                #[allow(cast_ptr_alignment)]
+                #[allow(clippy::cast_ptr_alignment)]
                 let x = (reg[_dst] as *const u8).offset(insn.off as isize) as *mut u32;
                 let x = (reg[_dst] as *const u8).offset(insn.off as isize) as *mut u32;
                 check_mem_store(x as u64, 4, insn_ptr)?;
                 check_mem_store(x as u64, 4, insn_ptr)?;
                 x.write_unaligned(insn.imm as u32);
                 x.write_unaligned(insn.imm as u32);
             },
             },
             ebpf::ST_DW_IMM  => unsafe {
             ebpf::ST_DW_IMM  => unsafe {
-                #[allow(cast_ptr_alignment)]
+                #[allow(clippy::cast_ptr_alignment)]
                 let x = (reg[_dst] as *const u8).offset(insn.off as isize) as *mut u64;
                 let x = (reg[_dst] as *const u8).offset(insn.off as isize) as *mut u64;
                 check_mem_store(x as u64, 8, insn_ptr)?;
                 check_mem_store(x as u64, 8, insn_ptr)?;
                 x.write_unaligned(insn.imm as u64);
                 x.write_unaligned(insn.imm as u64);
@@ -184,19 +184,19 @@ pub fn execute_program(prog_: Option<&[u8]>, mem: &[u8], mbuff: &[u8], helpers:
                 x.write_unaligned(reg[_src] as u8);
                 x.write_unaligned(reg[_src] as u8);
             },
             },
             ebpf::ST_H_REG   => unsafe {
             ebpf::ST_H_REG   => unsafe {
-                #[allow(cast_ptr_alignment)]
+                #[allow(clippy::cast_ptr_alignment)]
                 let x = (reg[_dst] as *const u8).offset(insn.off as isize) as *mut u16;
                 let x = (reg[_dst] as *const u8).offset(insn.off as isize) as *mut u16;
                 check_mem_store(x as u64, 2, insn_ptr)?;
                 check_mem_store(x as u64, 2, insn_ptr)?;
                 x.write_unaligned(reg[_src] as u16);
                 x.write_unaligned(reg[_src] as u16);
             },
             },
             ebpf::ST_W_REG   => unsafe {
             ebpf::ST_W_REG   => unsafe {
-                #[allow(cast_ptr_alignment)]
+                #[allow(clippy::cast_ptr_alignment)]
                 let x = (reg[_dst] as *const u8).offset(insn.off as isize) as *mut u32;
                 let x = (reg[_dst] as *const u8).offset(insn.off as isize) as *mut u32;
                 check_mem_store(x as u64, 4, insn_ptr)?;
                 check_mem_store(x as u64, 4, insn_ptr)?;
                 x.write_unaligned(reg[_src] as u32);
                 x.write_unaligned(reg[_src] as u32);
             },
             },
             ebpf::ST_DW_REG  => unsafe {
             ebpf::ST_DW_REG  => unsafe {
-                #[allow(cast_ptr_alignment)]
+                #[allow(clippy::cast_ptr_alignment)]
                 let x = (reg[_dst] as *const u8).offset(insn.off as isize) as *mut u64;
                 let x = (reg[_dst] as *const u8).offset(insn.off as isize) as *mut u64;
                 check_mem_store(x as u64, 8, insn_ptr)?;
                 check_mem_store(x as u64, 8, insn_ptr)?;
                 x.write_unaligned(reg[_src]);
                 x.write_unaligned(reg[_src]);