diff mbox series

virtio_net: Remove unused case in virtio_skb_set_hash()

Message ID 20220509131432.16568-1-tangbin@cmss.chinamobile.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series virtio_net: Remove unused case in virtio_skb_set_hash() | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 2 this patch: 2
netdev/cc_maintainers warning 1 maintainers not CCed: edumazet@google.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 2 this patch: 2
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Tang Bin May 9, 2022, 1:14 p.m. UTC
In this function, "VIRTIO_NET_HASH_REPORT_NONE" is included
in "default", so it canbe removed.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
 drivers/net/virtio_net.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Jason Wang May 10, 2022, 2:05 a.m. UTC | #1
On Mon, May 9, 2022 at 9:17 PM Tang Bin <tangbin@cmss.chinamobile.com> wrote:
>
> In this function, "VIRTIO_NET_HASH_REPORT_NONE" is included
> in "default", so it canbe removed.
>
> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
> ---
>  drivers/net/virtio_net.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 87838cbe3..b3e5d8637 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -1172,7 +1172,6 @@ static void virtio_skb_set_hash(const struct virtio_net_hdr_v1_hash *hdr_hash,
>         case VIRTIO_NET_HASH_REPORT_IPv6_EX:
>                 rss_hash_type = PKT_HASH_TYPE_L3;
>                 break;
> -       case VIRTIO_NET_HASH_REPORT_NONE:
>         default:
>                 rss_hash_type = PKT_HASH_TYPE_NONE;

I wonder if we need to do things in the reverse. Warn for default and
only set NONE when it's NONE?

Thanks

>         }
> --
> 2.20.1.windows.1
>
>
>
Michael S. Tsirkin May 10, 2022, 5:22 a.m. UTC | #2
On Mon, May 09, 2022 at 09:14:32PM +0800, Tang Bin wrote:
> In this function, "VIRTIO_NET_HASH_REPORT_NONE" is included
> in "default", so it canbe removed.
> 
> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>

What's the point of this?

> ---
>  drivers/net/virtio_net.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 87838cbe3..b3e5d8637 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -1172,7 +1172,6 @@ static void virtio_skb_set_hash(const struct virtio_net_hdr_v1_hash *hdr_hash,
>  	case VIRTIO_NET_HASH_REPORT_IPv6_EX:
>  		rss_hash_type = PKT_HASH_TYPE_L3;
>  		break;
> -	case VIRTIO_NET_HASH_REPORT_NONE:
>  	default:
>  		rss_hash_type = PKT_HASH_TYPE_NONE;
>  	}
> -- 
> 2.20.1.windows.1
> 
>
diff mbox series

Patch

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 87838cbe3..b3e5d8637 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1172,7 +1172,6 @@  static void virtio_skb_set_hash(const struct virtio_net_hdr_v1_hash *hdr_hash,
 	case VIRTIO_NET_HASH_REPORT_IPv6_EX:
 		rss_hash_type = PKT_HASH_TYPE_L3;
 		break;
-	case VIRTIO_NET_HASH_REPORT_NONE:
 	default:
 		rss_hash_type = PKT_HASH_TYPE_NONE;
 	}