Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1505984imc; Mon, 11 Mar 2019 15:40:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqycSfWzKIZkMjEJyUSdQqUbkbg4Y9JzwfXieqZ/MHf3LuzZQhDsanDE4ggAA41tHIPWzIxL X-Received: by 2002:a63:4206:: with SMTP id p6mr32647676pga.26.1552344029954; Mon, 11 Mar 2019 15:40:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552344029; cv=none; d=google.com; s=arc-20160816; b=vky/B8MnjGPs0607yI94bU0WEI0jxWwWG80ZeWi2nyUcaxF1gll5y3QOAQfJAKCOjQ llqfSBHUR44z3pk2LC79WKCt5rjhf3jdi3R28WVBOqTf0ADWqJWXEK3Cexx2XXatd2DL 4mt9Wa4/KL7+iwz3vQBLJWanh2O+shh3XXTfBk6QMdPMQV7aIlLNhFAsuvtOVpwJ0hWP poLDcZgyce2UcwMAbDJjFMiRXhqHwMLuZmA6HT3sgHU2DJM1sovS8FTpnOFBKz/IcUEk N3cSkZwxEA0opQBzwVQy1mcuQiZ22/gnhJzC2qCSuwADdIISlifuKbx8MiXQ6JM9eM7T cv5w== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=B0Gw94XzvLUuTJQdHtbRj/TquIK2BadGDBT7hCDmJeU=; b=cR4ffWB7svQyNfA2IRGoKjDOpEIEieRjOQ6bF8Dqa0fmzAZoRI9TvVfjeWie6J673H 4vnddM/Pe9Tt+P2eefmPyRP4DqgELZTl9R1lOmqcHLlu9V1rtZ2qyHGneSbfWBeoWJwY bNMGnAzv0i1pJVMABjZyDMx5DmUcrYAn2tKCuP3Ciu4P/yCYNXMFkZP3MCvLggHbMqIN Cz/4+hGZEtcaVwr4UGxeYk5J+wn3lHzTpIL+RLTk/pQS8b+P0e4lYKmTrQUKnI7PGNt1 ssZ+5oBn69QRrlWojzjB47+LAvg37ZcmFq/qMarfoDUNbIWA7wzecQfceY5qga0fbw4y Hr1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=qnR6Fu8z; 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 16si5705733pgc.312.2019.03.11.15.40.12; Mon, 11 Mar 2019 15:40:29 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=qnR6Fu8z; 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 S1726167AbfCKWjZ (ORCPT + 99 others); Mon, 11 Mar 2019 18:39:25 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:57222 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725819AbfCKWjY (ORCPT ); Mon, 11 Mar 2019 18:39:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=B0Gw94XzvLUuTJQdHtbRj/TquIK2BadGDBT7hCDmJeU=; b=qnR6Fu8zBLqzI7BCOAWJ2JptQ wD1BgzIryHtJnB6abYwVy/DGQznaPl/DNIn7/ea5/FSwyc3SwegKCszeEhwr+17LoS1xghIVhDYSf NHfeEkWYfGVM6C/p7nBP8ErJcWVIeqpGYzFy3Md8YtQJsKc0XhGSIMrbFOdQ1pYeE4l370nCXSI2K O73ReBCPOUpOYW+2txs4RIzPm+x2LWMkV6zbQ1PfRGsW4p03lYSXBFPWozlE277vyFWNry1jeJfIM cv5QUJ14pRaxC2j2KuyCUh57zX7tRRA29fCCIAYgtuKJSZHOTamudwD5oO2XS64q/KQHjLzc/wF7/ H5Fz3IsLA==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=dragon.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3TZr-0000OM-9C; Mon, 11 Mar 2019 22:39:23 +0000 Subject: Re: [PATCH] VMCI: Use BIT() macro for bit definitions To: Vishnu DASA , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "virtualization@lists.linux-foundation.org" Cc: Pv-drivers References: <20190311220928.4560-1-vdasa@vmware.com> From: Randy Dunlap Message-ID: <8e80e76d-1793-fc45-9f89-cf8e61dc4a16@infradead.org> Date: Mon, 11 Mar 2019 15:38:56 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190311220928.4560-1-vdasa@vmware.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/11/19 3:09 PM, Vishnu DASA wrote: > No functional changes, cleanup only. > > Reviewed-by: Adit Ranadive > Reviewed-by: Jorgen Hansen > Signed-off-by: Vishnu Dasa > --- > include/linux/vmw_vmci_defs.h | 34 +++++++++++++++++----------------- > 1 file changed, 17 insertions(+), 17 deletions(-) > Now this header file needs to #include or for the BIT() macro. Do the users of this header file build cleanly anyway? Even if so, we prefer not to depend on implicit or accidental header file inclusions that may change in the future. > diff --git a/include/linux/vmw_vmci_defs.h b/include/linux/vmw_vmci_defs.h > index eaa1e762bf06..007e28053da8 100644 > --- a/include/linux/vmw_vmci_defs.h > +++ b/include/linux/vmw_vmci_defs.h > @@ -33,27 +33,27 @@ > #define VMCI_MAX_DEVICES 1 > > /* Status register bits. */ > -#define VMCI_STATUS_INT_ON 0x1 > +#define VMCI_STATUS_INT_ON BIT(0) > > /* Control register bits. */ > -#define VMCI_CONTROL_RESET 0x1 > -#define VMCI_CONTROL_INT_ENABLE 0x2 > -#define VMCI_CONTROL_INT_DISABLE 0x4 > +#define VMCI_CONTROL_RESET BIT(0) > +#define VMCI_CONTROL_INT_ENABLE BIT(1) > +#define VMCI_CONTROL_INT_DISABLE BIT(2) > > /* Capabilities register bits. */ > -#define VMCI_CAPS_HYPERCALL 0x1 > -#define VMCI_CAPS_GUESTCALL 0x2 > -#define VMCI_CAPS_DATAGRAM 0x4 > -#define VMCI_CAPS_NOTIFICATIONS 0x8 > -#define VMCI_CAPS_PPN64 0x10 > +#define VMCI_CAPS_HYPERCALL BIT(0) > +#define VMCI_CAPS_GUESTCALL BIT(1) > +#define VMCI_CAPS_DATAGRAM BIT(2) > +#define VMCI_CAPS_NOTIFICATIONS BIT(3) > +#define VMCI_CAPS_PPN64 BIT(4) > > /* Interrupt Cause register bits. */ > -#define VMCI_ICR_DATAGRAM 0x1 > -#define VMCI_ICR_NOTIFICATION 0x2 > +#define VMCI_ICR_DATAGRAM BIT(0) > +#define VMCI_ICR_NOTIFICATION BIT(1) > > /* Interrupt Mask register bits. */ > -#define VMCI_IMR_DATAGRAM 0x1 > -#define VMCI_IMR_NOTIFICATION 0x2 > +#define VMCI_IMR_DATAGRAM BIT(0) > +#define VMCI_IMR_NOTIFICATION BIT(1) > > /* Maximum MSI/MSI-X interrupt vectors in the device. */ > #define VMCI_MAX_INTRS 2 > @@ -463,9 +463,9 @@ struct vmci_datagram { > * datagram callback is invoked in a delayed context (not interrupt context). > */ > #define VMCI_FLAG_DG_NONE 0 > -#define VMCI_FLAG_WELLKNOWN_DG_HND 0x1 > -#define VMCI_FLAG_ANYCID_DG_HND 0x2 > -#define VMCI_FLAG_DG_DELAYED_CB 0x4 > +#define VMCI_FLAG_WELLKNOWN_DG_HND BIT(0) > +#define VMCI_FLAG_ANYCID_DG_HND BIT(1) > +#define VMCI_FLAG_DG_DELAYED_CB BIT(2) > > /* > * Maximum supported size of a VMCI datagram for routable datagrams. > @@ -694,7 +694,7 @@ struct vmci_qp_detach_msg { > }; > > /* VMCI Doorbell API. */ > -#define VMCI_FLAG_DELAYED_CB 0x01 > +#define VMCI_FLAG_DELAYED_CB BIT(0) > > typedef void (*vmci_callback) (void *client_data); > > -- ~Randy