diff --git a/ui/events/ozone/evdev/event_device_info.cc b/ui/events/ozone/evdev/event_device_info.cc
index a478509d27d19..f0c3f64eb9bd0 100644
--- a/ui/events/ozone/evdev/event_device_info.cc
+++ b/ui/events/ozone/evdev/event_device_info.cc
@@ -612,55 +612,55 @@ void EventDeviceInfo::SetName(const std::string& name) {
 bool EventDeviceInfo::HasEventType(unsigned int type) const {
   if (type > EV_MAX)
     return false;
-  return EvdevBitIsSet(ev_bits_.data(), type);
+  return EvdevBitIsSet(ev_bits_, type);
 }
 
 bool EventDeviceInfo::HasKeyEvent(unsigned int code) const {
   if (code > KEY_MAX)
     return false;
-  return EvdevBitIsSet(key_bits_.data(), code);
+  return EvdevBitIsSet(key_bits_, code);
 }
 
 bool EventDeviceInfo::HasRelEvent(unsigned int code) const {
   if (code > REL_MAX)
     return false;
-  return EvdevBitIsSet(rel_bits_.data(), code);
+  return EvdevBitIsSet(rel_bits_, code);
 }
 
 bool EventDeviceInfo::HasAbsEvent(unsigned int code) const {
   if (code > ABS_MAX)
     return false;
-  return EvdevBitIsSet(abs_bits_.data(), code);
+  return EvdevBitIsSet(abs_bits_, code);
 }
 
 bool EventDeviceInfo::HasMscEvent(unsigned int code) const {
   if (code > MSC_MAX)
     return false;
-  return EvdevBitIsSet(msc_bits_.data(), code);
+  return EvdevBitIsSet(msc_bits_, code);
 }
 
 bool EventDeviceInfo::HasSwEvent(unsigned int code) const {
   if (code > SW_MAX)
     return false;
-  return EvdevBitIsSet(sw_bits_.data(), code);
+  return EvdevBitIsSet(sw_bits_, code);
 }
 
 bool EventDeviceInfo::HasLedEvent(unsigned int code) const {
   if (code > LED_MAX)
     return false;
-  return EvdevBitIsSet(led_bits_.data(), code);
+  return EvdevBitIsSet(led_bits_, code);
 }
 
 bool EventDeviceInfo::HasFfEvent(unsigned int code) const {
   if (code > FF_MAX)
     return false;
-  return EvdevBitIsSet(ff_bits_.data(), code);
+  return EvdevBitIsSet(ff_bits_, code);
 }
 
 bool EventDeviceInfo::HasProp(unsigned int code) const {
   if (code > INPUT_PROP_MAX)
     return false;
-  return EvdevBitIsSet(prop_bits_.data(), code);
+  return EvdevBitIsSet(prop_bits_, code);
 }
 
 bool EventDeviceInfo::SupportsHeatmap() const {
diff --git a/ui/events/ozone/evdev/event_device_util.h b/ui/events/ozone/evdev/event_device_util.h
index 1e7bbeb00d24d..b214e7d044fd8 100644
--- a/ui/events/ozone/evdev/event_device_util.h
+++ b/ui/events/ozone/evdev/event_device_util.h
@@ -2,10 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef UNSAFE_BUFFERS_BUILD
-// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
-#pragma allow_unsafe_buffers
-#endif
+#include "base/containers/span.h"
+
+
 
 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_UTIL_H_
 #define UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_UTIL_H_
@@ -19,24 +18,24 @@ namespace ui {
 #define EVDEV_BITS_TO_LONGS(x) (((x) + EVDEV_LONG_BITS - 1) / EVDEV_LONG_BITS)
 #define EVDEV_BITS_TO_INT64(x) (((x) + EVDEV_INT64_BITS - 1) / EVDEV_INT64_BITS)
 
-static inline bool EvdevBitIsSet(const unsigned long* data, int bit) {
+static inline bool EvdevBitIsSet(base::span<const unsigned long>data, int bit) {
   return data[bit / EVDEV_LONG_BITS] & (1UL << (bit % EVDEV_LONG_BITS));
 }
 
-static inline bool EvdevBitUint64IsSet(const uint64_t* data, int bit) {
+static inline bool EvdevBitUint64IsSet(base::span<const uint64_t>data, int bit) {
   return data[bit / EVDEV_INT64_BITS] &
          ((uint64_t)1 << (bit % EVDEV_INT64_BITS));
 }
 
-static inline void EvdevSetBit(unsigned long* data, int bit) {
+static inline void EvdevSetBit(base::span<unsigned long>data, int bit) {
   data[bit / EVDEV_LONG_BITS] |= (1UL << (bit % EVDEV_LONG_BITS));
 }
 
-static inline void EvdevSetUint64Bit(uint64_t* data, int bit) {
+static inline void EvdevSetUint64Bit(base::span<uint64_t>data, int bit) {
   data[bit / EVDEV_INT64_BITS] |= ((uint64_t)1 << (bit % EVDEV_INT64_BITS));
 }
 
-static inline void EvdevClearBit(unsigned long* data, int bit) {
+static inline void EvdevClearBit(base::span<unsigned long>data, int bit) {
   data[bit / EVDEV_LONG_BITS] &= ~(1UL << (bit % EVDEV_LONG_BITS));
 }
 
diff --git a/ui/events/ozone/evdev/gamepad_event_converter_evdev.cc b/ui/events/ozone/evdev/gamepad_event_converter_evdev.cc
index 9c4ff9c7c9c1b..9b737b78274a3 100644
--- a/ui/events/ozone/evdev/gamepad_event_converter_evdev.cc
+++ b/ui/events/ozone/evdev/gamepad_event_converter_evdev.cc
@@ -63,8 +63,8 @@ GamepadEventConverterEvdev::GamepadEventConverterEvdev(
   const auto key_bits = devinfo.GetKeyBits();
   key_bits_.resize(EVDEV_BITS_TO_INT64(KEY_CNT));
   for (int i = 0; i < KEY_CNT; i++) {
-    if (EvdevBitIsSet(key_bits.data(), i)) {
-      EvdevSetUint64Bit(key_bits_.data(), i);
+    if (EvdevBitIsSet(key_bits, i)) {
+      EvdevSetUint64Bit(key_bits_, i);
     }
   }
 }
diff --git a/ui/events/ozone/evdev/microphone_mute_switch_event_converter_evdev.cc b/ui/events/ozone/evdev/microphone_mute_switch_event_converter_evdev.cc
index 10a02e0c06414..217ab2e9f2349 100644
--- a/ui/events/ozone/evdev/microphone_mute_switch_event_converter_evdev.cc
+++ b/ui/events/ozone/evdev/microphone_mute_switch_event_converter_evdev.cc
@@ -7,6 +7,7 @@
 #include <errno.h>
 #include <linux/input.h>
 
+#include "base/containers/auto_spanification_helper.h"
 #include "base/logging.h"
 #include "base/trace_event/trace_event.h"
 #include "ui/events/event_utils.h"
@@ -23,7 +24,7 @@ int32_t GetSwValue(int fd, unsigned int code) {
     PLOG(ERROR) << "Failed EVIOCGSW";
     return 0;
   }
-  return EvdevBitIsSet(bitmask, code);
+  return EvdevBitIsSet(base::span(bitmask), code);
 }
 
 }  // namespace
diff --git a/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc b/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc
index f52d27c2acf8b..857a0955f38f6 100644
--- a/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc
+++ b/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc
@@ -12,6 +12,7 @@
 #include <memory>
 #include <vector>
 
+#include "base/containers/span.h"
 #include "ash/constants/ash_features.h"
 #include "base/command_line.h"
 #include "base/compiler_specific.h"
@@ -250,7 +251,7 @@ class MockTouchEventConverterEvdev : public TouchEventConverterEvdev {
 
   ~MockTouchEventConverterEvdev() override;
 
-  void ConfigureReadMock(struct input_event* queue,
+  void ConfigureReadMock(base::span<struct input_event>queue,
                          long read_this_many,
                          long queue_index);
 
@@ -371,11 +372,11 @@ MockTouchEventConverterEvdev::~MockTouchEventConverterEvdev() {
   SetEnabled(false);
 }
 
-void MockTouchEventConverterEvdev::ConfigureReadMock(struct input_event* queue,
+void MockTouchEventConverterEvdev::ConfigureReadMock(base::span<struct input_event>queue,
                                                      long read_this_many,
                                                      long queue_index) {
   int nwrite = UNSAFE_TODO(
-      HANDLE_EINTR(write(write_pipe_, queue + queue_index,
+      HANDLE_EINTR(write(write_pipe_, queue.subspan(queue_index, read_this_many).data(),
                          sizeof(struct input_event) * read_this_many)));
   DPCHECK(nwrite ==
           static_cast<int>(sizeof(struct input_event) * read_this_many))
@@ -434,9 +435,9 @@ class TouchEventConverterEvdevTest : public testing::Test {
     shared_palm_state_.reset();
   }
 
-  void UpdateTime(struct input_event* queue, long count, timeval time) const {
+  void UpdateTime(base::span<struct input_event>queue, long count, timeval time) const {
     for (int i = 0; i < count; ++i) {
-      UNSAFE_TODO(queue[i]).time = time;
+      queue[i].time = time;
     }
   }
 
@@ -2413,8 +2414,8 @@ TEST_F(TouchEventConverterEvdevTest, ChangePen) {
 
   std::array<unsigned long, EVDEV_BITS_TO_LONGS(EV_CNT)> ev_bits = {};
   std::array<unsigned long, EVDEV_BITS_TO_LONGS(KEY_CNT)> key_bits = {};
-  ui::EvdevSetBit(ev_bits.data(), EV_KEY);
-  ui::EvdevSetBit(key_bits.data(), BTN_TOOL_PEN);
+  ui::EvdevSetBit(ev_bits, EV_KEY);
+  ui::EvdevSetBit(key_bits, BTN_TOOL_PEN);
 
   devinfo.SetEventTypes(ev_bits);
   devinfo.SetKeyEvents(key_bits);
@@ -2528,17 +2529,17 @@ TEST_F(TouchEventConverterEvdevTest, ChangeQuirkLeftButton) {
   // filtered out.
   for (int i = 0; i < EV_CNT; i++) {
     if (devinfo.HasEventType(i)) {
-      ui::EvdevSetBit(ev_bits.data(), i);
+      ui::EvdevSetBit(ev_bits, i);
     }
   }
   for (int i = 0; i < KEY_CNT; i++) {
     if (devinfo.HasKeyEvent(i) && i != BTN_TOUCH) {
-      ui::EvdevSetBit(key_bits.data(), i);
+      ui::EvdevSetBit(key_bits, i);
     }
   }
 
-  ui::EvdevSetBit(ev_bits.data(), EV_KEY);
-  ui::EvdevSetBit(key_bits.data(), BTN_LEFT);
+  ui::EvdevSetBit(ev_bits, EV_KEY);
+  ui::EvdevSetBit(key_bits, BTN_LEFT);
 
   devinfo.SetEventTypes(ev_bits);
   devinfo.SetKeyEvents(key_bits);
