]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mstflint: Fix coding style issues - left with LINUX_VERSION_CODE
authorIdan Mehalel <idanme@mellanox.com>
Tue, 24 Jul 2018 12:24:09 +0000 (15:24 +0300)
committerBrian Maly <brian.maly@oracle.com>
Tue, 22 Jan 2019 19:32:05 +0000 (14:32 -0500)
Description:
Issue: 1471556

Orabug: 28878697

(cherry picked from commit 30e70911bcc22ac77b13d537225d7499261caac8)
cherry-pick-repo=github.com/Mellanox/mstflint.git

Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
Files are relocated from 'kernel' directory to
'drivers/net/ethernet/mellanox/mstflint_access'

Signed-off-by: Qing Huang <qing.huang@oracle.com>
Reviewed-by: Aron Silverton <aron.silverton@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/mellanox/mstflint_access/mst.h
drivers/net/ethernet/mellanox/mstflint_access/mst_kernel.h
drivers/net/ethernet/mellanox/mstflint_access/mst_main.c
drivers/net/ethernet/mellanox/mstflint_access/mst_vpd.c

index 8e30bf49a6cafed254ccac05a55f6a04f490ff5e..84b3a393f972b9c2409ff9023f22e1fb25fe35f8 100644 (file)
@@ -1,33 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
 /*
- * Copyright (c) 2011-2014 Mellanox Technologies, Inc. All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses.  You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * Copyright (c) 2018 Mellanox Technologies. All rights reserved.
  */
 
 #ifndef _MST_H_
index 080155aec87c8c1b025193c647845449688dd368..2902177a206daea8bfbf953a756b45a49a8e59dd 100644 (file)
@@ -1,36 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
 /*
- * Copyright (c) 2011-2014 Mellanox Technologies, Inc. All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses.  You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * Copyright (c) 2018 Mellanox Technologies. All rights reserved.
  */
 
-
 #ifndef _MST_KERNEL_H_
 #define _MST_KERNEL_H_
 
@@ -72,9 +44,9 @@
 #define MST_VPD_DEFAULT_TOUT           2000    /* milli seconds */
 
 #define mst_err(format, arg...)        \
-       printk(KERN_ERR "%s: %s %d: " format, MST_PREFIX, __func__, __LINE__, ## arg)
+       pr_err("%s: %s %d: " format, MST_PREFIX, __func__, __LINE__, ## arg)
 #define mst_info(format, arg...)       \
-       printk(KERN_INFO "%s: %s %d: " format, MST_PREFIX, __func__, __LINE__, ## arg)
+       pr_info("%s: %s %d: " format, MST_PREFIX, __func__, __LINE__, ## arg)
 
 
 /****************************************************/
@@ -92,7 +64,7 @@ struct mst_dev_data {
        void                            *hw_addr;                               /* PCIMEM memory start */
        char                            name[MST_NAME_SIZE];    /* name of character device */
        enum dev_type           type;                                   /* type of device */
-       struct pci_dev          *pci_dev;                               /* device pci struct in kernel */
+       struct pci_dev      *pci_dev;                           /* device pci struct in kernel */
        struct list_head        list;                                   /* list of mst_devices */
        struct mutex            lock;                                   /* device lock */
        int                                     vpd_cap_addr;                   /* addr VPD capability */
index b811a53c4eb9daf11e424517a4a3bb8392df70a8..f27729a3654ea9e36d156eef3d510361cd58f249 100644 (file)
@@ -1,34 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
 /*
- * Copyright (c) 2011-2014 Mellanox Technologies, Inc. All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses.  You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * Copyright (c) 2018, Mellanox Technologies inc.  All rights reserved.
  */
+
 #include <linux/version.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -167,7 +141,7 @@ static int _vendor_specific_sem(struct mst_dev_data *dev, int state)
 
                        if (lock_val) { //semaphore is taken
                                retries++;
-                               msleep(1); // wait for current op to end
+                               udelay(1000); // wait for current op to end
                                continue;
                        }
                        //read ticket
@@ -929,7 +903,7 @@ static int mst_ioctl(struct inode *inode, struct file *file,
                }
 
                if (dev->spaces_support_status != SS_ALL_SPACES_SUPPORTED) {
-                       res = -ENOSYS;
+                       res = -EOPNOTSUPP;
                        goto fin;
                }
 
@@ -968,7 +942,7 @@ static int mst_ioctl(struct inode *inode, struct file *file,
                }
 
                if (dev->spaces_support_status != SS_ALL_SPACES_SUPPORTED) {
-                       res = -ENOSYS;
+                       res = -EOPNOTSUPP;
                        goto fin;
                }
 
@@ -1209,7 +1183,7 @@ static int mst_ioctl(struct inode *inode, struct file *file,
 
 fin:
        if (IS_LOCK_NEEDED(dev))
-       mutex_unlock(&dev->lock);
+               mutex_unlock(&dev->lock);
 fin_err:
        return res;
 }
@@ -1277,12 +1251,8 @@ static struct mst_dev_data *mst_device_create(enum dev_type type,
        char dbdf[20];
 
        dev = kzalloc(sizeof(struct mst_dev_data), GFP_KERNEL);
-       if (!dev) {
-               mst_err("failed allocating new %s device with id=0x%x\n",
-                               dev_type_to_str(type),
-                               pdev->device);
+       if (!dev)
                return NULL;
-       }
 
        sprintf(dbdf, "%4.4x:%2.2x:%2.2x.%1.1x", pci_domain_nr(pdev->bus),
                        pdev->bus->number, PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
@@ -1326,13 +1296,13 @@ static struct mst_dev_data *mst_device_create(enum dev_type type,
                mst_err("failed to allocate chrdev_region\n");
        dev->cl = class_create(THIS_MODULE, dev->name);
        if (dev->cl == NULL) {
-               printk(KERN_ALERT "Class creation failed\n");
+               pr_alert("Class creation failed\n");
                unregister_chrdev_region(dev->my_dev, 1);
                goto out;
        }
 
        if (device_create(dev->cl, NULL, dev->my_dev, NULL, dev->name) == NULL) {
-               printk(KERN_ALERT "Device creation failed\n");
+               pr_alert("Device creation failed\n");
                class_destroy(dev->cl);
                unregister_chrdev_region(dev->my_dev, 1);
                goto out;
index f8ce128b90fe8a18989581e5c104b4d3194c9341..ff5a5cae06649084ca0f9310e4a23a4a4bd895f6 100644 (file)
@@ -1,33 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
 /*
- * Copyright (c) 2011-2014 Mellanox Technologies, Inc. All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses.  You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * Copyright (c) 2018, Mellanox Technologies inc.  All rights reserved.
  */
 
 #include <linux/highmem.h>