{
struct svc_msg *svc_msg;
- if (payload_length != sizeof(struct svc_function_handshake)) {
+ if (payload_length != sizeof(*handshake)) {
dev_err(hd->parent,
"Illegal size of svc handshake message %d\n",
payload_length);
svc_msg->header.function_id = SVC_FUNCTION_HANDSHAKE;
svc_msg->header.message_type = SVC_MSG_DATA;
svc_msg->header.payload_length =
- cpu_to_le16(sizeof(struct svc_function_handshake));
+ cpu_to_le16(sizeof(*handshake));
svc_msg->handshake.version_major = GREYBUS_VERSION_MAJOR;
svc_msg->handshake.version_minor = GREYBUS_VERSION_MINOR;
svc_msg->handshake.handshake_type = SVC_HANDSHAKE_AP_HELLO;
struct gb_module *module;
int ret;
- if (payload_length != sizeof(struct svc_function_unipro_management)) {
+ if (payload_length != sizeof(*management)) {
dev_err(hd->parent,
"Illegal size of svc management message %d\n",
payload_length);
* big, we can just check the union of the whole structure to validate
* the size of this message.
*/
- if (payload_length != sizeof(struct svc_function_power)) {
+ if (payload_length != sizeof(*power)) {
dev_err(hd->parent,
"Illegal size of svc power message %d\n",
payload_length);
else
data_out_size += (u32)msg->len;
- request_size = sizeof(struct gb_i2c_transfer_request);
- request_size += msg_count * sizeof(struct gb_i2c_transfer_op);
+ request_size = sizeof(*request);
+ request_size += msg_count * sizeof(*op);
request_size += data_out_size;
/* Response consists only of incoming data */
}
break;
case GREYBUS_TYPE_STRING:
- expected_size = sizeof(struct greybus_descriptor_header);
+ expected_size = sizeof(*desc_header);
expected_size += sizeof(struct greybus_descriptor_string);
expected_size += (size_t)desc->string.length;
if (desc_size < expected_size) {