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@xxxxxxxxx> > > > > Add miscellaneous utility functions and headers. > > > > Signed-off-by: Mustafa Ismail <mustafa.ismail@xxxxxxxxx> > > Signed-off-by: Shiraz Saleem <shiraz.saleem@xxxxxxxxx> > > 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
Attachment:
signature.asc
Description: PGP signature