Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: Paul Menzel <pmenzel@molgen.mpg.de>
Cc: intel-wired-lan@lists.osuosl.org,
	Marcin Szycik <marcin.szycik@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH net-next] ice: Fix implicit cast u32 to u16
Date: Tue, 28 Feb 2023 16:21:35 +0100	[thread overview]
Message-ID: <afebb832-6216-6410-3974-5388c3fe7201@intel.com> (raw)
In-Reply-To: <7d2b1ae3-2bec-1456-3df9-7fb04105c681@molgen.mpg.de>

From: Paul Menzel <pmenzel@molgen.mpg.de>
Date: Tue, 28 Feb 2023 11:01:00 +0100

> Dear Kalyan, dear Marcin,
> 
> 
> Am 28.02.23 um 09:49 schrieb Kalyan Kodamagula:
>> From: Marcin Szycik <marcin.szycik@intel.com>
>>
>> Fix implicit cast by changing argument types of two functions to correct
>> types.
>>
>> Signed-off-by: Marcin Szycik <marcin.szycik@intel.com>
>> Signed-off-by: Kalyan Kodamagula <kalyan.kodamagula@intel.com>
>> ---
>>   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:
> 
> Is there a reason to limit the length or could `unsigned int` be used?

You mean the string length? But what's the point of using `unsigned int`
if we have shorter and more elegant `u32`, which at the same time
explicitly states its width? :)
I've been encouraging lots o' folks to prefer the "shorties" where
possible (I basically only use {,unsigned} long from the "basic" types)
and now this :p I'm not saying any opinion is correct or incorrect here,
since it's a matter of taste mostly I believe, just curious.

> 
> 
> Kind regards,
> 
> Paul
Thanks,
Olek
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

  reply	other threads:[~2023-02-28 15:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28  8:49 [Intel-wired-lan] [PATCH net-next] ice: Fix implicit cast u32 to u16 Kalyan Kodamagula
2023-02-28 10:01 ` Paul Menzel
2023-02-28 15:21   ` Alexander Lobakin [this message]
2023-02-28 15:44     ` Paul Menzel
2023-02-28 16:21       ` Alexander Lobakin
2023-02-28 15:29 ` Alexander Lobakin
2023-02-28 15:40   ` Paul Menzel
2023-02-28 16:14     ` Marcin Szycik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afebb832-6216-6410-3974-5388c3fe7201@intel.com \
    --to=aleksander.lobakin@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=marcin.szycik@intel.com \
    --cc=pmenzel@molgen.mpg.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox