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

goldfish: clean up the checkpatch warnings

Mostly spacing changes, also making the operations structure const

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alan and committed by
Greg Kroah-Hartman
d78055dc e0f682e0

+34 -26
+34 -26
drivers/tty/goldfish.c
··· 76 76 u32 count; 77 77 78 78 count = readl(base + GOLDFISH_TTY_BYTES_READY); 79 - if(count == 0) 79 + if (count == 0) 80 80 return IRQ_NONE; 81 81 82 82 count = tty_prepare_flip_string(&qtty->port, &buf, count); ··· 92 92 93 93 static int goldfish_tty_activate(struct tty_port *port, struct tty_struct *tty) 94 94 { 95 - struct goldfish_tty *qtty = container_of(port, struct goldfish_tty, port); 95 + struct goldfish_tty *qtty = container_of(port, struct goldfish_tty, 96 + port); 96 97 writel(GOLDFISH_TTY_CMD_INT_ENABLE, qtty->base + GOLDFISH_TTY_CMD); 97 98 return 0; 98 99 } 99 100 100 101 static void goldfish_tty_shutdown(struct tty_port *port) 101 102 { 102 - struct goldfish_tty *qtty = container_of(port, struct goldfish_tty, port); 103 + struct goldfish_tty *qtty = container_of(port, struct goldfish_tty, 104 + port); 103 105 writel(GOLDFISH_TTY_CMD_INT_DISABLE, qtty->base + GOLDFISH_TTY_CMD); 104 106 } 105 107 106 - static int goldfish_tty_open(struct tty_struct * tty, struct file * filp) 108 + static int goldfish_tty_open(struct tty_struct *tty, struct file *filp) 107 109 { 108 110 struct goldfish_tty *qtty = &goldfish_ttys[tty->index]; 109 111 return tty_port_open(&qtty->port, tty, filp); 110 112 } 111 113 112 - static void goldfish_tty_close(struct tty_struct * tty, struct file * filp) 114 + static void goldfish_tty_close(struct tty_struct *tty, struct file *filp) 113 115 { 114 116 tty_port_close(tty->port, tty, filp); 115 117 } ··· 121 119 tty_port_hangup(tty->port); 122 120 } 123 121 124 - static int goldfish_tty_write(struct tty_struct * tty, const unsigned char *buf, int count) 122 + static int goldfish_tty_write(struct tty_struct *tty, const unsigned char *buf, 123 + int count) 125 124 { 126 125 goldfish_tty_do_write(tty->index, buf, count); 127 126 return count; ··· 140 137 return readl(base + GOLDFISH_TTY_BYTES_READY); 141 138 } 142 139 143 - static void goldfish_tty_console_write(struct console *co, const char *b, unsigned count) 140 + static void goldfish_tty_console_write(struct console *co, const char *b, 141 + unsigned count) 144 142 { 145 143 goldfish_tty_do_write(co->index, b, count); 146 144 } 147 145 148 - static struct tty_driver *goldfish_tty_console_device(struct console *c, int *index) 146 + static struct tty_driver *goldfish_tty_console_device(struct console *c, 147 + int *index) 149 148 { 150 149 *index = c->index; 151 150 return goldfish_tty_driver; ··· 155 150 156 151 static int goldfish_tty_console_setup(struct console *co, char *options) 157 152 { 158 - if((unsigned)co->index > goldfish_tty_line_count) 153 + if ((unsigned)co->index > goldfish_tty_line_count) 159 154 return -ENODEV; 160 - if(goldfish_ttys[co->index].base == 0) 155 + if (goldfish_ttys[co->index].base == 0) 161 156 return -ENODEV; 162 157 return 0; 163 158 } ··· 167 162 .shutdown = goldfish_tty_shutdown 168 163 }; 169 164 170 - static struct tty_operations goldfish_tty_ops = { 165 + static const struct tty_operations goldfish_tty_ops = { 171 166 .open = goldfish_tty_open, 172 167 .close = goldfish_tty_close, 173 168 .hangup = goldfish_tty_hangup, ··· 181 176 int ret; 182 177 struct tty_driver *tty; 183 178 184 - goldfish_ttys = kzalloc(sizeof(*goldfish_ttys) * goldfish_tty_line_count, GFP_KERNEL); 185 - if(goldfish_ttys == NULL) { 179 + goldfish_ttys = kzalloc(sizeof(*goldfish_ttys) * 180 + goldfish_tty_line_count, GFP_KERNEL); 181 + if (goldfish_ttys == NULL) { 186 182 ret = -ENOMEM; 187 183 goto err_alloc_goldfish_ttys_failed; 188 184 } 189 185 tty = alloc_tty_driver(goldfish_tty_line_count); 190 - if(tty == NULL) { 186 + if (tty == NULL) { 191 187 ret = -ENOMEM; 192 188 goto err_alloc_tty_driver_failed; 193 189 } ··· 197 191 tty->type = TTY_DRIVER_TYPE_SERIAL; 198 192 tty->subtype = SERIAL_TYPE_NORMAL; 199 193 tty->init_termios = tty_std_termios; 200 - tty->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; 194 + tty->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW | 195 + TTY_DRIVER_DYNAMIC_DEV; 201 196 tty_set_operations(tty, &goldfish_tty_ops); 202 197 ret = tty_register_driver(tty); 203 - if(ret) 198 + if (ret) 204 199 goto err_tty_register_driver_failed; 205 200 206 201 goldfish_tty_driver = tty; ··· 236 229 u32 irq; 237 230 238 231 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 239 - if(r == NULL) 232 + if (r == NULL) 240 233 return -EINVAL; 241 234 242 235 base = ioremap(r->start, 0x1000); ··· 244 237 pr_err("goldfish_tty: unable to remap base\n"); 245 238 246 239 r = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 247 - if(r == NULL) 240 + if (r == NULL) 248 241 goto err_unmap; 249 242 250 243 irq = r->start; 251 244 252 - if(pdev->id >= goldfish_tty_line_count) 245 + if (pdev->id >= goldfish_tty_line_count) 253 246 goto err_unmap; 254 247 255 248 mutex_lock(&goldfish_tty_lock); 256 - if(goldfish_tty_current_line_count == 0) { 249 + if (goldfish_tty_current_line_count == 0) { 257 250 ret = goldfish_tty_create_driver(); 258 - if(ret) 251 + if (ret) 259 252 goto err_create_driver_failed; 260 253 } 261 254 goldfish_tty_current_line_count++; ··· 269 262 270 263 writel(GOLDFISH_TTY_CMD_INT_DISABLE, base + GOLDFISH_TTY_CMD); 271 264 272 - ret = request_irq(irq, goldfish_tty_interrupt, IRQF_SHARED, "goldfish_tty", pdev); 273 - if(ret) 265 + ret = request_irq(irq, goldfish_tty_interrupt, IRQF_SHARED, 266 + "goldfish_tty", pdev); 267 + if (ret) 274 268 goto err_request_irq_failed; 275 269 276 270 277 271 ttydev = tty_port_register_device(&qtty->port, goldfish_tty_driver, 278 272 pdev->id, &pdev->dev); 279 - if(IS_ERR(ttydev)) { 273 + if (IS_ERR(ttydev)) { 280 274 ret = PTR_ERR(ttydev); 281 275 goto err_tty_register_device_failed; 282 276 } ··· 298 290 free_irq(irq, pdev); 299 291 err_request_irq_failed: 300 292 goldfish_tty_current_line_count--; 301 - if(goldfish_tty_current_line_count == 0) 293 + if (goldfish_tty_current_line_count == 0) 302 294 goldfish_tty_delete_driver(); 303 295 err_create_driver_failed: 304 296 mutex_unlock(&goldfish_tty_lock); ··· 320 312 qtty->base = 0; 321 313 free_irq(qtty->irq, pdev); 322 314 goldfish_tty_current_line_count--; 323 - if(goldfish_tty_current_line_count == 0) 315 + if (goldfish_tty_current_line_count == 0) 324 316 goldfish_tty_delete_driver(); 325 317 mutex_unlock(&goldfish_tty_lock); 326 318 return 0;