lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 28 Sep 2019 08:53:22 +0300
From:   Leon Romanovsky <leon@...nel.org>
To:     "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
Cc:     "Saleem, Shiraz" <shiraz.saleem@...el.com>,
        "Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
        "dledford@...hat.com" <dledford@...hat.com>,
        "jgg@...lanox.com" <jgg@...lanox.com>,
        "Ismail, Mustafa" <mustafa.ismail@...el.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>
Subject: Re: [RFC 15/20] RDMA/irdma: Add miscellaneous utility definitions

On Fri, Sep 27, 2019 at 08:23:46PM +0200, gregkh@...uxfoundation.org wrote:
> On Fri, Sep 27, 2019 at 02:28:20PM +0000, Saleem, Shiraz wrote:
> > > Subject: Re: [RFC 15/20] RDMA/irdma: Add miscellaneous utility definitions
> > >
> > > On Thu, Sep 26, 2019 at 07:49:33PM +0000, Saleem, Shiraz wrote:
> > > > > Subject: Re: [RFC 15/20] RDMA/irdma: Add miscellaneous utility
> > > > > definitions
> > > > >
> > > > > On Thu, Sep 26, 2019 at 09:45:14AM -0700, Jeff Kirsher 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  |  108 ++
> > > > > >  drivers/infiniband/hw/irdma/protos.h |   96 ++
> > > > > >  drivers/infiniband/hw/irdma/status.h |   70 +
> > > > > >  drivers/infiniband/hw/irdma/utils.c  | 2333
> > > > > > ++++++++++++++++++++++++++
> > > > > >  4 files changed, 2607 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 000000000000..5885b6fa413d
> > > > > > --- /dev/null
> > > > > > +++ b/drivers/infiniband/hw/irdma/osdep.h
> > > > > > @@ -0,0 +1,108 @@
> > > > > > +/* 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 MAKEMASK(m, s) ((m) << (s))
> > > > >
> > > > > It is a little bit over-macro.
> > > > >
> > > >
> > > > Why is this a problem?
> > > > We are not translating any basic kernel construct here.
> > >
> > > See BIT() definition.
> > >
> > OK. And?
>
> And you just re-created GENMASK().  Please use in-kernel definitions
> instead of creating your own.

More on that, they also redefined so basic C-operation that it looks
embarrassing. I tried to find any advantages of doing that and failed.
 * Does it save typing (less to type) significantly ? - No
 * Is it different between compilers/archs? - No
 * Is it so tricky that average developer needs helper? - No

Thanks

>
> thanks,
>
> greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ