From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44564C10DCE for ; Wed, 18 Mar 2020 09:13:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D1ED2076D for ; Wed, 18 Mar 2020 09:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584522833; bh=K9d7Q4ibY31/9Tj95TOmMoRmMlZS3Do7zERJLvevqak=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=cd6UlJJerBa/L7tcgxZa1JS5fs2QFquELjaBHnPfCuRuORzpRSPiiQH9zLjwxUTWz Mu7HMiG+tb1Wqx6nHMKazcWSG26iKJf3mAFGktMEf04lzxbyutP5wWNo9f5TsJ/SrR UM3fMsAaHqXCZhPhGIS1L9/6ixIoSMqjAQ9lojRs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbgCRJNw (ORCPT ); Wed, 18 Mar 2020 05:13:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:58614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726994AbgCRJNw (ORCPT ); Wed, 18 Mar 2020 05:13:52 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3EF3820767; Wed, 18 Mar 2020 09:13:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584522831; bh=K9d7Q4ibY31/9Tj95TOmMoRmMlZS3Do7zERJLvevqak=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wv/5Rs6dX3i+R9gWL3Qubfsobb4NHKXjJZwD6biJGdju1r3oF967LPkT4B1GXVT5l VmKl44wkaKpyJUJYk4PVleodK4DNJHLtQqcAUCTHFzEKMBvTR5oFHVs5s5qI1AvO09 hOPm4D0rkiVnIcas3CO+MHxBR10ddL24udOG3ykg= Date: Wed, 18 Mar 2020 11:13:48 +0200 From: Leon Romanovsky To: Jason Gunthorpe Cc: Gal Pressman , Doug Ledford , linux-rdma@vger.kernel.org Subject: Re: [PATCH rdma-next v1 03/11] RDMA/efa: Use in-kernel offsetofend() to check field availability Message-ID: <20200318091348.GS3351@unreal> References: <20200310091438.248429-1-leon@kernel.org> <20200310091438.248429-4-leon@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Sun, Mar 15, 2020 at 09:44:04AM +0200, Gal Pressman wrote: > On 10/03/2020 11:14, Leon Romanovsky wrote: > > From: Leon Romanovsky > > > > Remove custom and duplicated variant of offsetofend(). > > > > Signed-off-by: Leon Romanovsky > > --- > > drivers/infiniband/hw/efa/efa_verbs.c | 7 ++----- > > 1 file changed, 2 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c > > index bf3120f140f7..5c57098a4aee 100644 > > --- a/drivers/infiniband/hw/efa/efa_verbs.c > > +++ b/drivers/infiniband/hw/efa/efa_verbs.c > > @@ -144,9 +144,6 @@ static inline bool is_rdma_read_cap(struct efa_dev *dev) > > return dev->dev_attr.device_caps & EFA_ADMIN_FEATURE_DEVICE_ATTR_DESC_RDMA_READ_MASK; > > } > > > > -#define field_avail(x, fld, sz) (offsetof(typeof(x), fld) + \ > > - sizeof_field(typeof(x), fld) <= (sz)) > > I would use offsetofend here and keep the field_avail naming for readability > sake of the using functions, but I guess that's fine as well. > > Thanks Leon, > Acked-by: Gal Pressman Jason, Can you please pick this patch? Thanks