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

mtd: maps: physmap: Fix coding style issues reported by checkpatch

Fix the following coding style issues:
- != NULL and == NULL test replaced by ! (or nothing)
- split over 80 chars lines
- add missing braces in multi-line if() {} else {} statements

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>

+18 -15
+18 -15
drivers/mtd/maps/physmap.c
··· 38 38 int i, err; 39 39 40 40 info = platform_get_drvdata(dev); 41 - if (info == NULL) 41 + if (!info) 42 42 return 0; 43 43 44 44 physmap_data = dev_get_platdata(&dev->dev); ··· 53 53 } 54 54 55 55 for (i = 0; i < info->nmaps; i++) { 56 - if (info->mtds[i] != NULL) 56 + if (info->mtds[i]) 57 57 map_destroy(info->mtds[i]); 58 58 } 59 59 ··· 90 90 } 91 91 92 92 static const char * const rom_probe_types[] = { 93 - "cfi_probe", "jedec_probe", "qinfo_probe", "map_rom", NULL }; 93 + "cfi_probe", "jedec_probe", "qinfo_probe", "map_rom", NULL 94 + }; 94 95 95 96 static const char * const part_probe_types[] = { 96 - "cmdlinepart", "RedBoot", "afs", NULL }; 97 + "cmdlinepart", "RedBoot", "afs", NULL 98 + }; 97 99 98 100 static int physmap_flash_probe(struct platform_device *dev) 99 101 { ··· 107 105 int i; 108 106 109 107 physmap_data = dev_get_platdata(&dev->dev); 110 - if (physmap_data == NULL) 108 + if (!physmap_data) 111 109 return -ENODEV; 112 110 113 - info = devm_kzalloc(&dev->dev, sizeof(struct physmap_flash_info), 114 - GFP_KERNEL); 111 + info = devm_kzalloc(&dev->dev, sizeof(*info), GFP_KERNEL); 115 112 if (!info) 116 113 return -ENOMEM; 117 114 ··· 164 163 simple_map_init(&info->maps[i]); 165 164 166 165 probe_type = rom_probe_types; 167 - if (physmap_data->probe_type == NULL) { 168 - for (; info->mtds[i] == NULL && *probe_type != NULL; probe_type++) 169 - info->mtds[i] = do_map_probe(*probe_type, &info->maps[i]); 170 - } else 171 - info->mtds[i] = do_map_probe(physmap_data->probe_type, &info->maps[i]); 166 + if (!physmap_data->probe_type) { 167 + for (; !info->mtds[i] && *probe_type; probe_type++) 168 + info->mtds[i] = do_map_probe(*probe_type, 169 + &info->maps[i]); 170 + } else { 171 + info->mtds[i] = do_map_probe(physmap_data->probe_type, 172 + &info->maps[i]); 173 + } 172 174 173 - if (info->mtds[i] == NULL) { 175 + if (!info->mtds[i]) { 174 176 dev_err(&dev->dev, "map_probe failed\n"); 175 177 err = -ENXIO; 176 178 goto err_out; ··· 189 185 */ 190 186 info->cmtd = mtd_concat_create(info->mtds, info->nmaps, 191 187 dev_name(&dev->dev)); 192 - if (info->cmtd == NULL) 188 + if (!info->cmtd) 193 189 err = -ENXIO; 194 190 } 195 191 if (err) ··· 234 230 .name = "physmap-flash", 235 231 }, 236 232 }; 237 - 238 233 239 234 #ifdef CONFIG_MTD_PHYSMAP_COMPAT 240 235 static struct physmap_flash_data physmap_flash_data = {