Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7717748ybi; Mon, 22 Jul 2019 19:15:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZCRZoruKt+jpTuSc1q7Hr5s/wj1GU8pCYR5qvVcWFPmg/xx3O/RlLIKo1JPMCT6VirimG X-Received: by 2002:a17:90a:8d86:: with SMTP id d6mr79618527pjo.94.1563848145814; Mon, 22 Jul 2019 19:15:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563848145; cv=none; d=google.com; s=arc-20160816; b=Ki64q4kd2ytNhjhCFoiyhG2GucwauGLmX9JSAFh/onDwspzjA3OK+Zk9upFpOpkmYx BVxnQFlXkdGhP+tF5NG0O0DL5KjtC/3lEAU10hufLonU7AMm//U8vr9tMcp6853H3/+0 uKF3DbVO8bmAjh16Ne1VyXZX84QSIHdsp3UOLypmSNDS/EMywpr0sRnZIhrxNHFBs+Pn 9FDEU3BSjkLTxBN3Wg7XQS76RD4ZJ+UoWaptrj1TggtSQNCw3qVS8yya72CV24dkdAjU EVvONuKINz8Wzxib+zGVzxDHD4UqmkTrQXwD3qJ2uyJmugWufU9cEutV/syZS573K/6o cBow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=VE6mNo6BW9cNwzIMUhNdWseeE0XpHt3a4ve6PTMoXKI=; b=trBdQZmqZhcLO0RNHkk8Vd3LIAS0paGGgk3hJ+4ytVKn8yi5U5QYBj67VuR+M1mIkx JPiSY3n/ro27jEt4F+1JpV2ejWQ9EvT9HqsUkGmoNun4vpg858M+n8f4kNMriMTjWD3q DT6haLxJgTpMrLsWlotBQmL31QnhVAeBIjB8X85M1yHnQA1cWo3Kw9Jc3cP/B7mpHoXG QvDl3w8im5lJNDyg5pFFKqfiXUjqBsxJ6zoxdGbZrTJDfq7by6aIpe0ci1Q1u3KMvod2 kXqRQPpBEkYGUI72i/PXbT4Md1gBTbie0loxURE9xhjG3VJ/snNh04Mv2iUPR85GXatc zTdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7si10287439pjo.88.2019.07.22.19.15.29; Mon, 22 Jul 2019 19:15:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730856AbfGVTJC (ORCPT + 99 others); Mon, 22 Jul 2019 15:09:02 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:47920 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726527AbfGVTJC (ORCPT ); Mon, 22 Jul 2019 15:09:02 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id AE38815258BA1; Mon, 22 Jul 2019 12:09:01 -0700 (PDT) Date: Mon, 22 Jul 2019 12:09:01 -0700 (PDT) Message-Id: <20190722.120901.1770656295609872438.davem@davemloft.net> To: cai@lca.pw Cc: saeedm@mellanox.com, leonro@mellanox.com, yishaih@mellanox.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net/mlx5: fix -Wtype-limits compilation warnings From: David Miller In-Reply-To: <1563820482-10302-1-git-send-email-cai@lca.pw> References: <1563820482-10302-1-git-send-email-cai@lca.pw> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 22 Jul 2019 12:09:02 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qian Cai Date: Mon, 22 Jul 2019 14:34:42 -0400 > The commit b9a7ba556207 ("net/mlx5: Use event mask based on device > capabilities") introduced a few compilation warnings due to it bumps > MLX5_EVENT_TYPE_MAX from 0x27 to 0x100 which is always greater than > an "struct {mlx5_eqe|mlx5_nb}.type" that is an "u8". > > drivers/net/ethernet/mellanox/mlx5/core/eq.c: In function > 'mlx5_eq_notifier_register': > drivers/net/ethernet/mellanox/mlx5/core/eq.c:948:21: warning: comparison > is always false due to limited range of data type [-Wtype-limits] > if (nb->event_type >= MLX5_EVENT_TYPE_MAX) > ^~ > drivers/net/ethernet/mellanox/mlx5/core/eq.c: In function > 'mlx5_eq_notifier_unregister': > drivers/net/ethernet/mellanox/mlx5/core/eq.c:959:21: warning: comparison > is always false due to limited range of data type [-Wtype-limits] > if (nb->event_type >= MLX5_EVENT_TYPE_MAX) > > Fix them by removing unnecessary checkings. > > Fixes: b9a7ba556207 ("net/mlx5: Use event mask based on device capabilities") > Signed-off-by: Qian Cai Saeed, I am assuming that you will take this.