public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: liweihang <liweihang@huawei.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: "dledford@redhat.com" <dledford@redhat.com>,
	"leon@kernel.org" <leon@kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	Linuxarm <linuxarm@huawei.com>, chenglang <chenglang@huawei.com>
Subject: Re: [PATCH RESEND v2 for-next 1/7] RDMA/hns: Fix potential compile warnings on hr_reg_write()
Date: Thu, 17 Jun 2021 06:33:26 +0000	[thread overview]
Message-ID: <59ca0489be9a44a082bd1bed130ea3ff@huawei.com> (raw)
In-Reply-To: 20210616194012.GA1844581@nvidia.com

On 2021/6/17 3:40, Jason Gunthorpe wrote:
> 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
> 

I add a check for the integer mtu from ib_mtu_enum_to_int(), and gcc stop to
complain about that. I will add a patch to this series to fix it. Thank you.

Weihang

  reply	other threads:[~2021-06-17  6:33 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
2021-06-17  6:33     ` liweihang [this message]
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=59ca0489be9a44a082bd1bed130ea3ff@huawei.com \
    --to=liweihang@huawei.com \
    --cc=chenglang@huawei.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox