Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andrew F. Davis and committed by
Greg Kroah-Hartman
91bd2855 b04e0854

-41
-6
drivers/w1/masters/matrox_w1.c
··· 36 36 37 37 #include "../w1.h" 38 38 #include "../w1_int.h" 39 - #include "../w1_log.h" 40 39 41 40 MODULE_LICENSE("GPL"); 42 41 MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); ··· 156 157 struct matrox_device *dev; 157 158 int err; 158 159 159 - assert(pdev != NULL); 160 - assert(ent != NULL); 161 - 162 160 if (pdev->vendor != PCI_VENDOR_ID_MATROX || pdev->device != PCI_DEVICE_ID_MATROX_G400) 163 161 return -ENODEV; 164 162 ··· 219 223 static void matrox_w1_remove(struct pci_dev *pdev) 220 224 { 221 225 struct matrox_device *dev = pci_get_drvdata(pdev); 222 - 223 - assert(dev != NULL); 224 226 225 227 if (dev->found) { 226 228 w1_remove_master_device(dev->bus_master);
-1
drivers/w1/w1.c
··· 29 29 #include <linux/atomic.h> 30 30 31 31 #include "w1.h" 32 - #include "w1_log.h" 33 32 #include "w1_int.h" 34 33 #include "w1_family.h" 35 34 #include "w1_netlink.h"
-1
drivers/w1/w1_int.c
··· 22 22 #include <linux/moduleparam.h> 23 23 24 24 #include "w1.h" 25 - #include "w1_log.h" 26 25 #include "w1_netlink.h" 27 26 #include "w1_int.h" 28 27
-1
drivers/w1/w1_io.c
··· 19 19 #include <linux/module.h> 20 20 21 21 #include "w1.h" 22 - #include "w1_log.h" 23 22 24 23 static int w1_delay_parm = 1; 25 24 module_param_named(delay_coef, w1_delay_parm, int, 0);
-31
drivers/w1/w1_log.h
··· 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 -
-1
drivers/w1/w1_netlink.c
··· 18 18 #include <linux/connector.h> 19 19 20 20 #include "w1.h" 21 - #include "w1_log.h" 22 21 #include "w1_netlink.h" 23 22 24 23 #if defined(CONFIG_W1_CON) && (defined(CONFIG_CONNECTOR) || (defined(CONFIG_CONNECTOR_MODULE) && defined(CONFIG_W1_MODULE)))