All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Weihang Li <liweihang@huawei.com>
Cc: dledford@redhat.com, leon@kernel.org, linux-rdma@vger.kernel.org,
	linuxarm@huawei.com, Lang Cheng <chenglang@huawei.com>
Subject: Re: [PATCH RESEND v2 for-next 1/7] RDMA/hns: Fix potential compile warnings on hr_reg_write()
Date: Wed, 16 Jun 2021 16:40:12 -0300	[thread overview]
Message-ID: <20210616194012.GA1844581@nvidia.com> (raw)
In-Reply-To: <1622624265-44796-2-git-send-email-liweihang@huawei.com>

On Wed, Jun 02, 2021 at 04:57:39PM +0800, Weihang Li wrote:
> From: Lang Cheng <chenglang@huawei.com>
> 
> GCC may reports an running time assert error when a value calculated from
> ib_mtu_enum_to_int() is using as 'val' in FIELD_PREDP:
> 
> include/linux/compiler_types.h:328:38: error: call to
> '__compiletime_assert_1524' declared with attribute error: FIELD_PREP:
> value too large for the field

Huh? This warning looks reliable to me, you should not suppress it
like this.

> But actually this error will still exists even if the driver can ensure
> that ib_mtu_enum_to_int() returns a legal value. So add a mask in
> hr_reg_write() to avoid above warning.

I think you need to have an if that ib_mtu_enum_to_int() is not
negative, that should satisfy the CFA?

Jason

  reply	other threads:[~2021-06-16 19:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02  8:57 [PATCH RESEND v2 for-next 0/7] RDMA/hns: Use new interfaces to write/read fields Weihang Li
2021-06-02  8:57 ` [PATCH RESEND v2 for-next 1/7] RDMA/hns: Fix potential compile warnings on hr_reg_write() Weihang Li
2021-06-16 19:40   ` Jason Gunthorpe [this message]
2021-06-17  6:33     ` liweihang
2021-06-02  8:57 ` [PATCH RESEND v2 for-next 2/7] RDMA/hns: Use new interface to write CQ context Weihang Li
2021-06-02  8:57 ` [PATCH RESEND v2 for-next 3/7] RDMA/hns: Use new interface to modify QP context Weihang Li
2021-06-02  8:57 ` [PATCH RESEND v2 for-next 4/7] RDMA/hns: Use new interface to get CQE fields Weihang Li
2021-06-02  8:57 ` [PATCH RESEND v2 for-next 5/7] RDMA/hns: Use new interface to write FRMR fields Weihang Li
2021-06-02  8:57 ` [PATCH RESEND v2 for-next 6/7] RDMA/hns: Use new interface to write DB related fields Weihang Li
2021-06-02  8:57 ` [PATCH RESEND v2 for-next 7/7] RDMA/hns: Clean SRQC structure definition Weihang Li

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=20210616194012.GA1844581@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=chenglang@huawei.com \
    --cc=dledford@redhat.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liweihang@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.