Pass const argument to miiSelectorChecksumIsValid
Computing a checksum does not modify its argment.
This commit is contained in:
parent
869d0ce44b
commit
452fddc658
@ -108,4 +108,4 @@ Result miiSelectorLaunch(MiiSelectorContext *ctx);
|
|||||||
*
|
*
|
||||||
* @return `true` if `returnbuf->checksum` is the same as the one computed from `returnbuf`
|
* @return `true` if `returnbuf->checksum` is the same as the one computed from `returnbuf`
|
||||||
*/
|
*/
|
||||||
bool miiSelectorChecksumIsValid(MiiSelectorReturn *returnbuf);
|
bool miiSelectorChecksumIsValid(const MiiSelectorReturn *returnbuf);
|
||||||
|
@ -33,7 +33,7 @@ static u16 crc16_ccitt(void const *buf, size_t len, uint32_t starting_val)
|
|||||||
return (u16)(crc & 0xffff);
|
return (u16)(crc & 0xffff);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool miiSelectorChecksumIsValid(MiiSelectorReturn *returnbuf)
|
bool miiSelectorChecksumIsValid(const MiiSelectorReturn *returnbuf)
|
||||||
{
|
{
|
||||||
u16 computed =
|
u16 computed =
|
||||||
crc16_ccitt(&returnbuf->mii, sizeof(returnbuf->mii) + sizeof(returnbuf->_pad0x68), 0x0000);
|
crc16_ccitt(&returnbuf->mii, sizeof(returnbuf->mii) + sizeof(returnbuf->_pad0x68), 0x0000);
|
||||||
|
Loading…
Reference in New Issue
Block a user