public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Dave Penkler <dpenkler@gmail.com>
To: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Cc: Dave Penkler <dpenkler@gmail.com>
Subject: [PATCH 4/4] staging: gpib: Add bit and byte padding to ioctl structs
Date: Tue,  3 Jun 2025 20:43:20 +0200	[thread overview]
Message-ID: <20250603184320.30594-5-dpenkler@gmail.com> (raw)
In-Reply-To: <20250603184320.30594-1-dpenkler@gmail.com>

Ensure that all structs have a size that is an integral mutliple
of 32 bits.

Change trailing single bit field to __u32 in gpib_open_dev_ioctl
Add byte padding to  gpib_serial_poll_ioctl and gpib_request_service2
Add bit padding to gpib_board_info_ioctl and gpib_ppoll_config_ioctl

Signed-off-by: Dave Penkler <dpenkler@gmail.com>
---
 drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h
index 0da47e28caaa..55bf5e55507a 100644
--- a/drivers/staging/gpib/uapi/gpib_ioctl.h
+++ b/drivers/staging/gpib/uapi/gpib_ioctl.h
@@ -29,7 +29,7 @@ struct gpib_open_dev_ioctl {
 	__u32 handle;
 	__u32 pad;
 	__s32 sad;
-	unsigned is_board : 1;
+	__u32 is_board;
 };
 
 struct gpib_close_dev_ioctl {
@@ -40,6 +40,7 @@ struct gpib_serial_poll_ioctl {
 	__u32 pad;
 	__s32 sad;
 	__u8 status_byte;
+	__u8 padding[3];   // align to 32 bit boundary
 };
 
 struct gpib_eos_ioctl {
@@ -79,6 +80,7 @@ struct gpib_board_info_ioctl {
 	__u32 t1_delay;
 	unsigned ist : 1;
 	unsigned no_7_bit_eos : 1;
+	unsigned padding :30; // align to 32 bit boundary
 };
 
 struct gpib_select_pci_ioctl {
@@ -90,6 +92,7 @@ struct gpib_ppoll_config_ioctl {
 	__u8 config;
 	unsigned set_ist : 1;
 	unsigned clear_ist : 1;
+	unsigned padding :22; // align to 32 bit boundary
 };
 
 struct gpib_pad_ioctl {
@@ -110,6 +113,7 @@ struct gpib_select_device_path_ioctl {
 // update status byte and request service
 struct gpib_request_service2 {
 	__u8 status_byte;
+	__u8 padding[3]; // align to 32 bit boundary
 	__s32 new_reason_for_service;
 };
 
-- 
2.49.0


      parent reply	other threads:[~2025-06-03 18:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-03 18:43 [PATCH 0/4] staging: gpib: Clean up uapi include files Dave Penkler
2025-06-03 18:43 ` [PATCH 1/4] staging: gpib: Remove unneeded enums and functions Dave Penkler
2025-06-03 18:43 ` [PATCH 2/4] staging: gpib: Add local include file for commands Dave Penkler
2025-06-03 18:43 ` [PATCH 3/4] staging: gpib: Use standard size basic uapi types Dave Penkler
2025-06-03 18:43 ` Dave Penkler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250603184320.30594-5-dpenkler@gmail.com \
    --to=dpenkler@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox