@@ -92,13 +92,13 @@ static const char* detectWithDdcci(FF_MAYBE_UNUSED const FFDisplayServerResult*
9292
9393 for (uint32_t i = 0 ; i < 2 ; ++ i )
9494 {
95- IOAVServiceWriteI2C (service , 0x37 , 0x51 , i2cIn , sizeof (i2cIn ));
95+ IOAVServiceWriteI2C (service , 0x37 , 0x51 , i2cIn , ARRAY_SIZE (i2cIn ));
9696 usleep (options -> ddcciSleep * 1000 );
9797 }
9898 }
9999
100100 uint8_t i2cOut [12 ] = {};
101- if (IOAVServiceReadI2C (service , 0x37 , 0x51 , i2cOut , sizeof (i2cOut )) == KERN_SUCCESS )
101+ if (IOAVServiceReadI2C (service , 0x37 , 0x51 , i2cOut , ARRAY_SIZE (i2cOut )) == KERN_SUCCESS )
102102 {
103103 if (i2cOut [2 ] != 0x02 || i2cOut [3 ] != 0x00 )
104104 continue ;
@@ -113,7 +113,7 @@ static const char* detectWithDdcci(FF_MAYBE_UNUSED const FFDisplayServerResult*
113113 ffStrbufInit (& brightness -> name );
114114
115115 uint8_t edid [128 ] = {};
116- if (IOAVServiceReadI2C (service , 0x50 , 0x00 , edid , sizeof (edid )) == KERN_SUCCESS )
116+ if (IOAVServiceReadI2C (service , 0x50 , 0x00 , edid , ARRAY_SIZE (edid )) == KERN_SUCCESS )
117117 ffEdidGetName (edid , & brightness -> name );
118118 }
119119 }
@@ -155,12 +155,12 @@ static const char* detectWithDdcci(const FFDisplayServerResult* displayServer, F
155155 .sendAddress = 0x6e ,
156156 .sendTransactionType = kIOI2CSimpleTransactionType ,
157157 .sendBuffer = (vm_address_t ) i2cIn ,
158- .sendBytes = sizeof (i2cIn ) / sizeof ( i2cIn [ 0 ] ),
158+ .sendBytes = ARRAY_SIZE (i2cIn ),
159159 .minReplyDelay = options -> ddcciSleep ,
160160 .replyAddress = 0x6F ,
161161 .replySubAddress = 0x51 ,
162162 .replyTransactionType = kIOI2CDDCciReplyTransactionType ,
163- .replyBytes = sizeof (i2cOut ) / sizeof ( i2cOut [ 0 ] ),
163+ .replyBytes = ARRAY_SIZE (i2cOut ),
164164 .replyBuffer = (vm_address_t ) i2cOut ,
165165 };
166166 IOReturn ret = IOI2CSendRequest (connect , kNilOptions , & request );
0 commit comments