Commit 5087227
committed
ioctl: Clean up error handling and return codes
Simplify the init routine by:
- Removing unnecessary temporary variables
- Adding spacing between declarations and statements
- Using early return on alloc_chrdev_region() failure
- Propagating the actual error code instead of always returning -1
- Dropping redundant checks in the error path
This makes the error handling clearer and more consistent with
common kernel coding style.1 parent a8b652b commit 5087227
1 file changed
+10
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | | - | |
157 | | - | |
| 155 | + | |
158 | 156 | | |
159 | | - | |
160 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | | - | |
167 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | 174 | | |
179 | 175 | | |
180 | 176 | | |
| |||
0 commit comments