[PATCH v3 3/3] iio: ssp_sensors: cleanup codestyle warning

From: Sanjay Chitroda

Date: Sun Mar 15 2026 - 08:57:32 EST


From: Sanjay Chitroda <sanjayembeddedse@xxxxxxxxx>

Reported by checkpatch:
FILE: drivers/iio/common/ssp_sensors/ssp_spi.c

WARNING: Prefer __packed over __attribute__((__packed__))
+} __attribute__((__packed__));

CHECK: Macro argument '...' may be better as '(...)'
to avoid precedence issues

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@xxxxxxxxx>
---
drivers/iio/common/ssp_sensors/ssp_spi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/common/ssp_sensors/ssp_spi.c b/drivers/iio/common/ssp_sensors/ssp_spi.c
index 9df94bd02e3a..8a52bfb0e39c 100644
--- a/drivers/iio/common/ssp_sensors/ssp_spi.c
+++ b/drivers/iio/common/ssp_sensors/ssp_spi.c
@@ -7,7 +7,7 @@
#include "ssp.h"

#define SSP_DEV (&data->spi->dev)
-#define SSP_GET_MESSAGE_TYPE(data) (data & (3 << SSP_RW))
+#define SSP_GET_MESSAGE_TYPE(data) ((data) & (3 << SSP_RW))

/*
* SSP -> AP Instruction
@@ -30,7 +30,7 @@ struct ssp_msg_header {
__le16 length;
__le16 options;
__le32 data;
-} __attribute__((__packed__));
+} __packed;

struct ssp_msg {
u16 length;
@@ -120,9 +120,9 @@ static inline void ssp_get_buffer(struct ssp_msg *m, unsigned int offset,
}

#define SSP_GET_BUFFER_AT_INDEX(m, index) \
- (m->buffer[SSP_HEADER_SIZE_ALIGNED + index])
+ ((m)->buffer[SSP_HEADER_SIZE_ALIGNED + (index)])
#define SSP_SET_BUFFER_AT_INDEX(m, index, val) \
- (m->buffer[SSP_HEADER_SIZE_ALIGNED + index] = val)
+ ((m)->buffer[SSP_HEADER_SIZE_ALIGNED + (index)] = val)

static void ssp_clean_msg(struct ssp_msg *m)
{
--
2.34.1