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

mfd: ab3100-core.c: Fix multiple warnings reported by Checkpatch

WARNING: Missing a blank line after declarations
+ struct ab3100 *ab3100 = dev_get_drvdata(dev->parent);
+ if (!ab3100->startup_events_read)

WARNING: Possible unnecessary 'out of memory' message
+ if (!ab3100) {
+ dev_err(&client->dev, "could not allocate AB3100 device\n");

WARNING: else is not generally useful after a break or return
+ break;
+ } else {

total: 0 errors, 3 warnings, 996 lines checked

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

Lee Jones 15544cab 4374b20c

+10 -13
+10 -13
drivers/mfd/ab3100-core.c
··· 381 381 u8 *event) 382 382 { 383 383 struct ab3100 *ab3100 = dev_get_drvdata(dev->parent); 384 + 384 385 if (!ab3100->startup_events_read) 385 386 return -EAGAIN; /* Try again later */ 386 387 memcpy(event, ab3100->startup_events, 3); 388 + 387 389 return 0; 388 390 } 389 391 ··· 860 858 int i; 861 859 862 860 ab3100 = devm_kzalloc(&client->dev, sizeof(struct ab3100), GFP_KERNEL); 863 - if (!ab3100) { 864 - dev_err(&client->dev, "could not allocate AB3100 device\n"); 861 + if (!ab3100) 865 862 return -ENOMEM; 866 - } 867 863 868 864 /* Initialize data structure */ 869 865 mutex_init(&ab3100->access_mutex); ··· 883 883 884 884 for (i = 0; ids[i].id != 0x0; i++) { 885 885 if (ids[i].id == ab3100->chip_id) { 886 - if (ids[i].name != NULL) { 887 - snprintf(&ab3100->chip_name[0], 888 - sizeof(ab3100->chip_name) - 1, 889 - "AB3100 %s", 890 - ids[i].name); 886 + if (ids[i].name) 891 887 break; 892 - } else { 893 - dev_err(&client->dev, 894 - "AB3000 is not supported\n"); 895 - goto exit_no_detect; 896 - } 888 + 889 + dev_err(&client->dev, "AB3000 is not supported\n"); 890 + goto exit_no_detect; 897 891 } 898 892 } 893 + 894 + snprintf(&ab3100->chip_name[0], 895 + sizeof(ab3100->chip_name) - 1, "AB3100 %s", ids[i].name); 899 896 900 897 if (ids[i].id == 0x0) { 901 898 dev_err(&client->dev, "unknown analog baseband chip id: 0x%x\n",