summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew F. Davis <afd@ti.com>2017-03-16 11:19:54 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-08 12:20:57 -0400
commit91bd2855edbc6a941bf0b16990fbf2894c41c388 (patch)
tree3ba75b7c58bb29cd5535bdcbb990976faab7afef
parentb04e08549910626cda1dbe68ed600afa3ce2af81 (diff)
w1: Remove unneeded use of assert() and remove w1_log.h
The only use of assert() is in matrox_w1.c and is used to check the input to probe() from the PCI subsystem for NULL values, these are guaranteed to be populated and no other PCI driver makes this check, remove this. As this was the only definition in w1_log.h, remove this also. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/w1/masters/matrox_w1.c6
-rw-r--r--drivers/w1/w1.c1
-rw-r--r--drivers/w1/w1_int.c1
-rw-r--r--drivers/w1/w1_io.c1
-rw-r--r--drivers/w1/w1_log.h31
-rw-r--r--drivers/w1/w1_netlink.c1
6 files changed, 0 insertions, 41 deletions
diff --git a/drivers/w1/masters/matrox_w1.c b/drivers/w1/masters/matrox_w1.c
index 3749db8b4396..97a676bf5989 100644
--- a/drivers/w1/masters/matrox_w1.c
+++ b/drivers/w1/masters/matrox_w1.c
@@ -36,7 +36,6 @@
36 36
37#include "../w1.h" 37#include "../w1.h"
38#include "../w1_int.h" 38#include "../w1_int.h"
39#include "../w1_log.h"
40 39
41MODULE_LICENSE("GPL"); 40MODULE_LICENSE("GPL");
42MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); 41MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>");
@@ -157,9 +156,6 @@ static int matrox_w1_probe(struct pci_dev *pdev, const struct pci_device_id *ent
157 struct matrox_device *dev; 156 struct matrox_device *dev;
158 int err; 157 int err;
159 158
160 assert(pdev != NULL);
161 assert(ent != NULL);
162
163 if (pdev->vendor != PCI_VENDOR_ID_MATROX || pdev->device != PCI_DEVICE_ID_MATROX_G400) 159 if (pdev->vendor != PCI_VENDOR_ID_MATROX || pdev->device != PCI_DEVICE_ID_MATROX_G400)
164 return -ENODEV; 160 return -ENODEV;
165 161
@@ -224,8 +220,6 @@ static void matrox_w1_remove(struct pci_dev *pdev)
224{ 220{
225 struct matrox_device *dev = pci_get_drvdata(pdev); 221 struct matrox_device *dev = pci_get_drvdata(pdev);
226 222
227 assert(dev != NULL);
228
229 if (dev->found) { 223 if (dev->found) {
230 w1_remove_master_device(dev->bus_master); 224 w1_remove_master_device(dev->bus_master);
231 iounmap(dev->virt_addr); 225 iounmap(dev->virt_addr);
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 90a3d9338fd2..8511d1685db9 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -29,7 +29,6 @@
29#include <linux/atomic.h> 29#include <linux/atomic.h>
30 30
31#include "w1.h" 31#include "w1.h"
32#include "w1_log.h"
33#include "w1_int.h" 32#include "w1_int.h"
34#include "w1_family.h" 33#include "w1_family.h"
35#include "w1_netlink.h" 34#include "w1_netlink.h"
diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c
index 2cae7b29bb5f..1072a2e620bb 100644
--- a/drivers/w1/w1_int.c
+++ b/drivers/w1/w1_int.c
@@ -22,7 +22,6 @@
22#include <linux/moduleparam.h> 22#include <linux/moduleparam.h>
23 23
24#include "w1.h" 24#include "w1.h"
25#include "w1_log.h"
26#include "w1_netlink.h" 25#include "w1_netlink.h"
27#include "w1_int.h" 26#include "w1_int.h"
28 27
diff --git a/drivers/w1/w1_io.c b/drivers/w1/w1_io.c
index de8bebc27896..1134e6b1eb02 100644
--- a/drivers/w1/w1_io.c
+++ b/drivers/w1/w1_io.c
@@ -19,7 +19,6 @@
19#include <linux/module.h> 19#include <linux/module.h>
20 20
21#include "w1.h" 21#include "w1.h"
22#include "w1_log.h"
23 22
24static int w1_delay_parm = 1; 23static int w1_delay_parm = 1;
25module_param_named(delay_coef, w1_delay_parm, int, 0); 24module_param_named(delay_coef, w1_delay_parm, int, 0);
diff --git a/drivers/w1/w1_log.h b/drivers/w1/w1_log.h
deleted file mode 100644
index dd1422b6afbb..000000000000
--- a/drivers/w1/w1_log.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * Copyright (c) 2004 Evgeniy Polyakov <zbr@ioremap.net>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#ifndef __W1_LOG_H
16#define __W1_LOG_H
17
18#define DEBUG
19
20#ifdef W1_DEBUG
21# define assert(expr) do {} while (0)
22#else
23# define assert(expr) \
24 if(unlikely(!(expr))) { \
25 pr_err("Assertion failed! %s,%s,%s,line=%d\n", \
26 #expr, __FILE__, __func__, __LINE__); \
27 }
28#endif
29
30#endif /* __W1_LOG_H */
31
diff --git a/drivers/w1/w1_netlink.c b/drivers/w1/w1_netlink.c
index 18374cad3ace..027950f997d1 100644
--- a/drivers/w1/w1_netlink.c
+++ b/drivers/w1/w1_netlink.c
@@ -18,7 +18,6 @@
18#include <linux/connector.h> 18#include <linux/connector.h>
19 19
20#include "w1.h" 20#include "w1.h"
21#include "w1_log.h"
22#include "w1_netlink.h" 21#include "w1_netlink.h"
23 22
24#if defined(CONFIG_W1_CON) && (defined(CONFIG_CONNECTOR) || (defined(CONFIG_CONNECTOR_MODULE) && defined(CONFIG_W1_MODULE))) 23#if defined(CONFIG_W1_CON) && (defined(CONFIG_CONNECTOR) || (defined(CONFIG_CONNECTOR_MODULE) && defined(CONFIG_W1_MODULE)))