[Intel-wired-lan] [PATCH net-next] ice: Fix implicit cast u32 to u16
Paul Menzel
pmenzel at molgen.mpg.de
Tue Feb 28 15:40:27 UTC 2023
Dear Alexander,
Am 28.02.23 um 16:29 schrieb Alexander Lobakin:
> From: Kalyan Kodamagula <kalyan.kodamagula at intel.com>
> Date: Tue, 28 Feb 2023 09:49:15 +0100
>
>> From: Marcin Szycik <marcin.szycik at intel.com>
>>
>> Fix implicit cast by changing argument types of two functions to correct
>> types.
>>
>> Signed-off-by: Marcin Szycik <marcin.szycik at intel.com>
>> Signed-off-by: Kalyan Kodamagula <kalyan.kodamagula at intel.com>
>
> Regarding the actual patch (below),
>
>> ---
>> drivers/net/ethernet/intel/ice/ice_ddp.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/ice/ice_ddp.c b/drivers/net/ethernet/intel/ice/ice_ddp.c
>> index d71ed210f9c4..830fa53b5e0a 100644
>> --- a/drivers/net/ethernet/intel/ice/ice_ddp.c
>> +++ b/drivers/net/ethernet/intel/ice/ice_ddp.c
>> @@ -701,14 +701,14 @@ struct ice_buf_build *ice_pkg_buf_alloc(struct ice_hw *hw)
>> return bld;
>> }
>>
>> -static bool ice_is_gtp_u_profile(u16 prof_idx)
>> +static bool ice_is_gtp_u_profile(u32 prof_idx)
>> {
>> return (prof_idx >= ICE_PROFID_IPV6_GTPU_TEID &&
>> prof_idx <= ICE_PROFID_IPV6_GTPU_IPV6_TCP_INNER) ||
>> prof_idx == ICE_PROFID_IPV4_GTPU_TEID;
>> }
>>
>> -static bool ice_is_gtp_c_profile(u16 prof_idx)
>> +static bool ice_is_gtp_c_profile(u32 prof_idx)
>> {
>> switch (prof_idx) {
>> case ICE_PROFID_IPV4_GTPC_TEID:
>
> What is this change really about? It might've been a part of some bigger
> series, isn't it? Does it fix any truncating-related bugs or improve
> codegen, which could be observed by objdiff or bloat-o-meter? It feels
> completely out of context.
I asked myself the same thing right now reading your other reply:
```
/**
* ice_get_sw_prof_type - determine switch profile type
* @hw: pointer to the HW structure
* @fv: pointer to the switch field vector
* @prof_idx: profile index to check
*/
static enum ice_prof_type ice_get_sw_prof_type(struct ice_hw *hw,
struct ice_fv *fv, u32
prof_idx)
{
u16 i;
if (ice_is_gtp_c_profile(prof_idx))
return ICE_PROF_TUN_GTPC;
if (ice_is_gtp_u_profile(prof_idx))
return ICE_PROF_TUN_GTPU;
[…]
```
I think they mean that the signature of ice_prof_type
ice_get_sw_prof_type() takes prof_idx as u32.
Kind regards,
Paul
More information about the Intel-wired-lan
mailing list