diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2007-08-15 12:32:13 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-08-24 01:27:24 -0400 |
commit | b173491339b9ae7f1322241ce6228c1268513a39 (patch) | |
tree | dca8b3a7021d7957d60023e34ac96a9df5215421 /drivers/pnp/resource.c | |
parent | 4f0217e30249ac0eb13b65ef64f2aee627465da2 (diff) |
PNP: remove null pointer checks
Remove some null pointer checks. Null pointers in these areas indicate
programming errors, and I think it's better to oops immediately rather
than return an error that is easily ignored.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Adam Belay <abelay@novell.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/resource.c')
-rw-r--r-- | drivers/pnp/resource.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index ea6ec14a0559..ef1286900db3 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c | |||
@@ -47,9 +47,6 @@ struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev) | |||
47 | { | 47 | { |
48 | struct pnp_option *option; | 48 | struct pnp_option *option; |
49 | 49 | ||
50 | if (!dev) | ||
51 | return NULL; | ||
52 | |||
53 | option = pnp_build_option(PNP_RES_PRIORITY_PREFERRED); | 50 | option = pnp_build_option(PNP_RES_PRIORITY_PREFERRED); |
54 | 51 | ||
55 | /* this should never happen but if it does we'll try to continue */ | 52 | /* this should never happen but if it does we'll try to continue */ |
@@ -64,9 +61,6 @@ struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev, | |||
64 | { | 61 | { |
65 | struct pnp_option *option; | 62 | struct pnp_option *option; |
66 | 63 | ||
67 | if (!dev) | ||
68 | return NULL; | ||
69 | |||
70 | option = pnp_build_option(priority); | 64 | option = pnp_build_option(priority); |
71 | 65 | ||
72 | if (dev->dependent) { | 66 | if (dev->dependent) { |
@@ -83,11 +77,6 @@ int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) | |||
83 | { | 77 | { |
84 | struct pnp_irq *ptr; | 78 | struct pnp_irq *ptr; |
85 | 79 | ||
86 | if (!option) | ||
87 | return -EINVAL; | ||
88 | if (!data) | ||
89 | return -EINVAL; | ||
90 | |||
91 | ptr = option->irq; | 80 | ptr = option->irq; |
92 | while (ptr && ptr->next) | 81 | while (ptr && ptr->next) |
93 | ptr = ptr->next; | 82 | ptr = ptr->next; |
@@ -112,11 +101,6 @@ int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) | |||
112 | { | 101 | { |
113 | struct pnp_dma *ptr; | 102 | struct pnp_dma *ptr; |
114 | 103 | ||
115 | if (!option) | ||
116 | return -EINVAL; | ||
117 | if (!data) | ||
118 | return -EINVAL; | ||
119 | |||
120 | ptr = option->dma; | 104 | ptr = option->dma; |
121 | while (ptr && ptr->next) | 105 | while (ptr && ptr->next) |
122 | ptr = ptr->next; | 106 | ptr = ptr->next; |
@@ -132,11 +116,6 @@ int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) | |||
132 | { | 116 | { |
133 | struct pnp_port *ptr; | 117 | struct pnp_port *ptr; |
134 | 118 | ||
135 | if (!option) | ||
136 | return -EINVAL; | ||
137 | if (!data) | ||
138 | return -EINVAL; | ||
139 | |||
140 | ptr = option->port; | 119 | ptr = option->port; |
141 | while (ptr && ptr->next) | 120 | while (ptr && ptr->next) |
142 | ptr = ptr->next; | 121 | ptr = ptr->next; |
@@ -152,11 +131,6 @@ int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data) | |||
152 | { | 131 | { |
153 | struct pnp_mem *ptr; | 132 | struct pnp_mem *ptr; |
154 | 133 | ||
155 | if (!option) | ||
156 | return -EINVAL; | ||
157 | if (!data) | ||
158 | return -EINVAL; | ||
159 | |||
160 | ptr = option->mem; | 134 | ptr = option->mem; |
161 | while (ptr && ptr->next) | 135 | while (ptr && ptr->next) |
162 | ptr = ptr->next; | 136 | ptr = ptr->next; |