public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ublk: specify io_cmd_buf pointer type
@ 2025-03-28 19:42 Caleb Sander Mateos
  2025-03-28 19:42 ` [PATCH 1/2] " Caleb Sander Mateos
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Caleb Sander Mateos @ 2025-03-28 19:42 UTC (permalink / raw)
  To: Ming Lei, Jens Axboe, Shuah Khan
  Cc: linux-block, linux-kernel, linux-kselftest, Caleb Sander Mateos

io_cmd_buf points to an array of ublksrv_io_desc structs but its type is
char *. Indexing the array requires an explicit multiplication and cast.
The compiler also can't check the pointer types.

Change io_cmd_buf's type to struct ublksrv_io_desc * so it can be
indexed directly and the compiler can type-check the code.

Make the same change to the ublk selftests.

Caleb Sander Mateos (2):
  ublk: specify io_cmd_buf pointer type
  selftests: ublk: specify io_cmd_buf pointer type

 drivers/block/ublk_drv.c             | 8 ++++----
 tools/testing/selftests/ublk/kublk.c | 2 +-
 tools/testing/selftests/ublk/kublk.h | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-03-29 11:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-28 19:42 [PATCH 0/2] ublk: specify io_cmd_buf pointer type Caleb Sander Mateos
2025-03-28 19:42 ` [PATCH 1/2] " Caleb Sander Mateos
2025-03-28 19:42 ` [PATCH 2/2] selftests: " Caleb Sander Mateos
2025-03-28 23:04 ` [PATCH 0/2] " Jens Axboe
2025-03-28 23:58 ` Shuah Khan
2025-03-29  0:24 ` Ming Lei
2025-03-29 11:57 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox