[PATCH] Formatting changes to vio.c

Formatting changes to vio.c to bring it closer to the
kernel coding standard.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Stephen Rothwell and committed by
Paul Mackerras
5c0b4b87 1e4a79e0

+17 -22
+17 -22
arch/ppc64/kernel/vio.c
··· 37 37 static void (*unregister_device_callback)(struct vio_dev *dev); 38 38 static void (*release_device_callback)(struct device *dev); 39 39 40 - /* convert from struct device to struct vio_dev and pass to driver. 40 + /* 41 + * Convert from struct device to struct vio_dev and pass to driver. 41 42 * dev->driver has already been set by generic code because vio_bus_match 42 - * succeeded. */ 43 + * succeeded. 44 + */ 43 45 static int vio_bus_probe(struct device *dev) 44 46 { 45 47 struct vio_dev *viodev = to_vio_dev(dev); ··· 53 51 return error; 54 52 55 53 id = vio_match_device(viodrv->id_table, viodev); 56 - if (id) { 54 + if (id) 57 55 error = viodrv->probe(viodev, id); 58 - } 59 56 60 57 return error; 61 58 } ··· 65 64 struct vio_dev *viodev = to_vio_dev(dev); 66 65 struct vio_driver *viodrv = to_vio_driver(dev->driver); 67 66 68 - if (viodrv->remove) { 67 + if (viodrv->remove) 69 68 return viodrv->remove(viodev); 70 - } 71 69 72 70 /* driver can't remove */ 73 71 return 1; ··· 102 102 EXPORT_SYMBOL(vio_unregister_driver); 103 103 104 104 /** 105 - * vio_match_device: - Tell if a VIO device has a matching VIO device id structure. 106 - * @ids: array of VIO device id structures to search in 107 - * @dev: the VIO device structure to match against 105 + * vio_match_device: - Tell if a VIO device has a matching 106 + * VIO device id structure. 107 + * @ids: array of VIO device id structures to search in 108 + * @dev: the VIO device structure to match against 108 109 * 109 110 * Used by a driver to check whether a VIO device present in the 110 111 * system is in its list of supported devices. Returns the matching 111 112 * vio_device_id structure or NULL if there is no match. 112 113 */ 113 - static const struct vio_device_id * vio_match_device(const struct vio_device_id *ids, 114 - const struct vio_dev *dev) 114 + static const struct vio_device_id *vio_match_device( 115 + const struct vio_device_id *ids, const struct vio_dev *dev) 115 116 { 116 117 while (ids->type) { 117 118 if (is_match(ids, dev)) ··· 142 141 return err; 143 142 } 144 143 145 - /* the fake parent of all vio devices, just to give us 144 + /* 145 + * The fake parent of all vio devices, just to give us 146 146 * a nice directory 147 147 */ 148 148 err = device_register(&vio_bus_device.dev); ··· 164 162 kfree(to_vio_dev(dev)); 165 163 } 166 164 167 - static ssize_t viodev_show_name(struct device *dev, struct device_attribute *attr, char *buf) 165 + static ssize_t viodev_show_name(struct device *dev, 166 + struct device_attribute *attr, char *buf) 168 167 { 169 168 return sprintf(buf, "%s\n", to_vio_dev(dev)->name); 170 169 } ··· 265 262 const struct vio_dev *vio_dev = to_vio_dev(dev); 266 263 struct vio_driver *vio_drv = to_vio_driver(drv); 267 264 const struct vio_device_id *ids = vio_drv->id_table; 268 - const struct vio_device_id *found_id; 269 265 270 - if (!ids) 271 - return 0; 272 - 273 - found_id = vio_match_device(ids, vio_dev); 274 - if (found_id) 275 - return 1; 276 - 277 - return 0; 266 + return (ids != NULL) && (vio_match_device(ids, vio_dev) != NULL); 278 267 } 279 268 280 269 struct bus_type vio_bus_type = {