[ofw] RE: [PATCH 2/6] [ib-diag] ibroute: add support for WinOF

Sean Hefty sean.hefty at intel.com
Thu Feb 26 13:45:36 PST 2009


>> @@ -1027,7 +1034,7 @@ static int query_path_records(const struct query_cmd
>*q, bind_handle_t h,
>>  	CHECK_AND_SET_VAL(p->dlid, 16, 0, pr.dlid, PR, DLID);
>>  	CHECK_AND_SET_VAL(p->hop_limit, 32, -1, pr.hop_flow_raw, PR, HOPLIMIT);
>>  	CHECK_AND_SET_VAL(p->flow_label, 8, 0, flow, PR, FLOWLABEL);
>> -	pr.hop_flow_raw |= cl_hton32(flow << 8);
>> +	pr.hop_flow_raw |= (uint8_t) cl_hton32(flow << 8);
>
>Why this casting is needed? This should be uint32_t to uint32_t
>assignment, no?

Hmm... the cast shouldn't be needed.

>> @@ -1267,7 +1274,7 @@ static int query_pkey_tbl_records(const struct
>query_cmd *q,
>>  	memset(&pktr, 0, sizeof(pktr));
>>  	CHECK_AND_SET_VAL(lid, 16, 0, pktr.lid, PKEY, LID);
>>  	CHECK_AND_SET_VAL(port, 8, -1, pktr.port_num, PKEY, PORT);
>> -	CHECK_AND_SET_VAL(block, 16, -1, pktr.port_num, PKEY, BLOCK);
>> +	CHECK_AND_SET_VAL(block, 16, -1, pktr.block_num, PKEY, BLOCK);
>
>This fix is unrelated to porting, right?

Somewhat - this is a real fix, but without it, there's a build error assigning a
uint16 to an 8-bit port_num.

I'll remove the cast above and change the (char *) casts to (uint8_t *) casts
instead.

- Sean




More information about the ofw mailing list