[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190220075127.GY16218@mtr-leonro.mtl.com>
Date: Wed, 20 Feb 2019 09:51:27 +0200
From: Leon Romanovsky <leon@...nel.org>
To: Jason Gunthorpe <jgg@...pe.ca>
Cc: Shiraz Saleem <shiraz.saleem@...el.com>, dledford@...hat.com,
davem@...emloft.net, linux-rdma@...r.kernel.org,
netdev@...r.kernel.org, mustafa.ismail@...el.com,
jeffrey.t.kirsher@...el.com
Subject: Re: [RFC v1 15/19] RDMA/irdma: Add miscellaneous utility definitions
On Fri, Feb 15, 2019 at 10:47:14AM -0700, Jason Gunthorpe wrote:
> On Fri, Feb 15, 2019 at 11:11:02AM -0600, Shiraz Saleem wrote:
> > From: Mustafa Ismail <mustafa.ismail@...el.com>
> >
> > Add miscellaneous utility functions and headers.
> >
> > Signed-off-by: Mustafa Ismail <mustafa.ismail@...el.com>
> > Signed-off-by: Shiraz Saleem <shiraz.saleem@...el.com>
> > drivers/infiniband/hw/irdma/osdep.h | 153 ++
> > drivers/infiniband/hw/irdma/protos.h | 118 ++
> > drivers/infiniband/hw/irdma/status.h | 70 +
> > drivers/infiniband/hw/irdma/utils.c | 2565 ++++++++++++++++++++++++++++++++++
> > 4 files changed, 2906 insertions(+)
> > create mode 100644 drivers/infiniband/hw/irdma/osdep.h
> > create mode 100644 drivers/infiniband/hw/irdma/protos.h
> > create mode 100644 drivers/infiniband/hw/irdma/status.h
> > create mode 100644 drivers/infiniband/hw/irdma/utils.c
> >
> > diff --git a/drivers/infiniband/hw/irdma/osdep.h b/drivers/infiniband/hw/irdma/osdep.h
> > new file mode 100644
> > index 0000000..ade5536
> > +++ b/drivers/infiniband/hw/irdma/osdep.h
> > @@ -0,0 +1,153 @@
> > +/* SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB */
> > +/* Copyright (c) 2019, Intel Corporation. */
> > +
> > +#ifndef IRDMA_OSDEP_H
> > +#define IRDMA_OSDEP_H
> > +
> > +#include <linux/version.h>
> > +#include <linux/kernel.h>
> > +#include <linux/vmalloc.h>
> > +#include <linux/string.h>
> > +#include <linux/bitops.h>
> > +#include <linux/pci.h>
> > +#include <net/tcp.h>
> > +#include <crypto/hash.h>
> > +/* get readq/writeq support for 32 bit kernels, use the low-first version */
> > +#include <linux/io-64-nonatomic-lo-hi.h>
> > +
> > +#define STATS_TIMER_DELAY 60000
> > +#define MAKEMASK(m, s) ((m) << (s))
Really? Abstraction for "<<"?
> > +
> > +#define irdma_pr_err(fmt, args ...) \
> > + pr_err("%s: "fmt, __func__, ## args)
> > +
> > +#define irdma_pr_info(fmt, args ...) \
> > + pr_info("%s: " fmt, __func__, ## args)
> > +
> > +#define irdma_pr_warn(fmt, args ...) \
> > + pr_warn("%s: " fmt, __func__, ## args)
> > +
> > +#define irdma_dev_err(dev, fmt, args ...) \
> > + dev_err(to_device(dev), "%s: "fmt, __func__, ## args)
> > +
> > +#define irdma_dev_info(dev, fmt, args ...) \
> > + dev_info(to_device(dev), "%s: "fmt, __func__, ## args)
> > +
> > +#define irdma_dev_warn(dev, fmt, args ...) \
> > + dev_warn(to_device(dev), "%s: "fmt, __func__, ## args)
>
> Does every driver really have to define these macros?
Every time when I see it, I'm asking myself the same question.
Thanks
Download attachment "signature.asc" of type "application/pgp-signature" (802 bytes)
Powered by blists - more mailing lists