diff for duplicates of <595c593e-8a24-24da-0731-e317bbf91d56@users.sourceforge.net> diff --git a/a/1.txt b/N1/1.txt index 4f711e4..3d698e8 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -23,7 +23,7 @@ index 30be5dbd5b09..165600c74b7c 100644 int z, tcode; d = context_get_descriptors(ctx, 4, &d_bus); -- if (d = NULL) { +- if (d == NULL) { + if (!d) { packet->ack = RCODE_SEND_ERROR; return -1; @@ -32,7 +32,7 @@ index 30be5dbd5b09..165600c74b7c 100644 driver_data = (struct driver_data *) &d[3]; packet = driver_data->packet; -- if (packet = NULL) +- if (packet == NULL) + if (!packet) /* This packet was cancelled, just continue. */ return 1; @@ -50,15 +50,16 @@ index 30be5dbd5b09..165600c74b7c 100644 dma_alloc_coherent(ohci->card.device, CONFIG_ROM_SIZE, &ohci->next_config_rom_bus, GFP_KERNEL); -- if (ohci->next_config_rom = NULL) +- if (ohci->next_config_rom == NULL) + if (!ohci->next_config_rom) return -ENOMEM; copy_config_rom(ohci->next_config_rom, config_rom, length); @@ -2488,7 +2488,7 @@ static int ohci_set_config_rom(struct fw_card *card, - next_config_rom dma_alloc_coherent(ohci->card.device, CONFIG_ROM_SIZE, + next_config_rom = + dma_alloc_coherent(ohci->card.device, CONFIG_ROM_SIZE, &next_config_rom_bus, GFP_KERNEL); -- if (next_config_rom = NULL) +- if (next_config_rom == NULL) + if (!next_config_rom) return -ENOMEM; @@ -67,7 +68,7 @@ index 30be5dbd5b09..165600c74b7c 100644 * let this routine free the unused DMA allocation. */ -- if (ohci->next_config_rom = NULL) { +- if (ohci->next_config_rom == NULL) { + if (!ohci->next_config_rom) { ohci->next_config_rom = next_config_rom; ohci->next_config_rom_bus = next_config_rom_bus; @@ -85,7 +86,7 @@ index 30be5dbd5b09..165600c74b7c 100644 memset(ctx, 0, sizeof(*ctx)); ctx->header_length = 0; ctx->header = (void *) __get_free_page(GFP_KERNEL); -- if (ctx->header = NULL) { +- if (ctx->header == NULL) { + if (!ctx->header) { ret = -ENOMEM; goto out; @@ -94,7 +95,7 @@ index 30be5dbd5b09..165600c74b7c 100644 header_z = DIV_ROUND_UP(p->header_length, sizeof(*d)); d = context_get_descriptors(&ctx->context, z + header_z, &d_bus); -- if (d = NULL) +- if (d == NULL) + if (!d) return -ENOMEM; @@ -103,7 +104,7 @@ index 30be5dbd5b09..165600c74b7c 100644 z = DIV_ROUND_UP(payload_per_buffer + offset, PAGE_SIZE) + 1; d = context_get_descriptors(&ctx->context, z + header_z, &d_bus); -- if (d = NULL) +- if (d == NULL) + if (!d) return -ENOMEM; @@ -112,7 +113,7 @@ index 30be5dbd5b09..165600c74b7c 100644 for (i = 0; i < z; i++) { d = context_get_descriptors(&ctx->context, 1, &d_bus); -- if (d = NULL) +- if (d == NULL) + if (!d) return -ENOMEM; @@ -121,7 +122,7 @@ index 30be5dbd5b09..165600c74b7c 100644 } ohci = kzalloc(sizeof(*ohci), GFP_KERNEL); -- if (ohci = NULL) { +- if (ohci == NULL) { + if (!ohci) { err = -ENOMEM; goto fail; @@ -130,7 +131,7 @@ index 30be5dbd5b09..165600c74b7c 100644 } ohci->registers = pci_iomap(dev, 0, OHCI1394_REGISTER_SIZE); -- if (ohci->registers = NULL) { +- if (ohci->registers == NULL) { + if (!ohci->registers) { ohci_err(ohci, "failed to remap registers\n"); err = -ENXIO; @@ -139,7 +140,7 @@ index 30be5dbd5b09..165600c74b7c 100644 ohci->it_context_list = kcalloc(ohci->n_it, sizeof(*ohci->it_context_list), GFP_KERNEL); -- if (ohci->it_context_list = NULL || ohci->ir_context_list = NULL) { +- if (ohci->it_context_list == NULL || ohci->ir_context_list == NULL) { + if (!ohci->it_context_list || !ohci->ir_context_list) { err = -ENOMEM; goto fail_contexts; diff --git a/a/content_digest b/N1/content_digest index b751fc1..662a0af 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,7 +1,7 @@ "ref\01139a329-f084-c4f3-d9af-19ad15445017@users.sourceforge.net\0" "From\0SF Markus Elfring <elfring@users.sourceforge.net>\0" "Subject\0[PATCH 2/2] firewire: ohci: Adjust 15 checks for null pointers\0" - "Date\0Thu, 20 Apr 2017 20:28:12 +0000\0" + "Date\0Thu, 20 Apr 2017 22:28:12 +0200\0" "To\0linux1394-devel@lists.sourceforge.net" " Stefan Richter <stefanr@s5r6.in-berlin.de>\0" "Cc\0LKML <linux-kernel@vger.kernel.org>" @@ -33,7 +33,7 @@ " \tint z, tcode;\n" " \n" " \td = context_get_descriptors(ctx, 4, &d_bus);\n" - "-\tif (d = NULL) {\n" + "-\tif (d == NULL) {\n" "+\tif (!d) {\n" " \t\tpacket->ack = RCODE_SEND_ERROR;\n" " \t\treturn -1;\n" @@ -42,7 +42,7 @@ " \n" " \tdriver_data = (struct driver_data *) &d[3];\n" " \tpacket = driver_data->packet;\n" - "-\tif (packet = NULL)\n" + "-\tif (packet == NULL)\n" "+\tif (!packet)\n" " \t\t/* This packet was cancelled, just continue. */\n" " \t\treturn 1;\n" @@ -60,15 +60,16 @@ " \t\t\tdma_alloc_coherent(ohci->card.device, CONFIG_ROM_SIZE,\n" " \t\t\t\t\t &ohci->next_config_rom_bus,\n" " \t\t\t\t\t GFP_KERNEL);\n" - "-\t\tif (ohci->next_config_rom = NULL)\n" + "-\t\tif (ohci->next_config_rom == NULL)\n" "+\t\tif (!ohci->next_config_rom)\n" " \t\t\treturn -ENOMEM;\n" " \n" " \t\tcopy_config_rom(ohci->next_config_rom, config_rom, length);\n" "@@ -2488,7 +2488,7 @@ static int ohci_set_config_rom(struct fw_card *card,\n" - " \tnext_config_rom \t\tdma_alloc_coherent(ohci->card.device, CONFIG_ROM_SIZE,\n" + " \tnext_config_rom =\n" + " \t\tdma_alloc_coherent(ohci->card.device, CONFIG_ROM_SIZE,\n" " \t\t\t\t &next_config_rom_bus, GFP_KERNEL);\n" - "-\tif (next_config_rom = NULL)\n" + "-\tif (next_config_rom == NULL)\n" "+\tif (!next_config_rom)\n" " \t\treturn -ENOMEM;\n" " \n" @@ -77,7 +78,7 @@ " \t * let this routine free the unused DMA allocation.\n" " \t */\n" " \n" - "-\tif (ohci->next_config_rom = NULL) {\n" + "-\tif (ohci->next_config_rom == NULL) {\n" "+\tif (!ohci->next_config_rom) {\n" " \t\tohci->next_config_rom = next_config_rom;\n" " \t\tohci->next_config_rom_bus = next_config_rom_bus;\n" @@ -95,7 +96,7 @@ " \tmemset(ctx, 0, sizeof(*ctx));\n" " \tctx->header_length = 0;\n" " \tctx->header = (void *) __get_free_page(GFP_KERNEL);\n" - "-\tif (ctx->header = NULL) {\n" + "-\tif (ctx->header == NULL) {\n" "+\tif (!ctx->header) {\n" " \t\tret = -ENOMEM;\n" " \t\tgoto out;\n" @@ -104,7 +105,7 @@ " \theader_z = DIV_ROUND_UP(p->header_length, sizeof(*d));\n" " \n" " \td = context_get_descriptors(&ctx->context, z + header_z, &d_bus);\n" - "-\tif (d = NULL)\n" + "-\tif (d == NULL)\n" "+\tif (!d)\n" " \t\treturn -ENOMEM;\n" " \n" @@ -113,7 +114,7 @@ " \t\tz = DIV_ROUND_UP(payload_per_buffer + offset, PAGE_SIZE) + 1;\n" " \t\td = context_get_descriptors(&ctx->context,\n" " \t\t\t\tz + header_z, &d_bus);\n" - "-\t\tif (d = NULL)\n" + "-\t\tif (d == NULL)\n" "+\t\tif (!d)\n" " \t\t\treturn -ENOMEM;\n" " \n" @@ -122,7 +123,7 @@ " \n" " \tfor (i = 0; i < z; i++) {\n" " \t\td = context_get_descriptors(&ctx->context, 1, &d_bus);\n" - "-\t\tif (d = NULL)\n" + "-\t\tif (d == NULL)\n" "+\t\tif (!d)\n" " \t\t\treturn -ENOMEM;\n" " \n" @@ -131,7 +132,7 @@ " \t}\n" " \n" " \tohci = kzalloc(sizeof(*ohci), GFP_KERNEL);\n" - "-\tif (ohci = NULL) {\n" + "-\tif (ohci == NULL) {\n" "+\tif (!ohci) {\n" " \t\terr = -ENOMEM;\n" " \t\tgoto fail;\n" @@ -140,7 +141,7 @@ " \t}\n" " \n" " \tohci->registers = pci_iomap(dev, 0, OHCI1394_REGISTER_SIZE);\n" - "-\tif (ohci->registers = NULL) {\n" + "-\tif (ohci->registers == NULL) {\n" "+\tif (!ohci->registers) {\n" " \t\tohci_err(ohci, \"failed to remap registers\\n\");\n" " \t\terr = -ENXIO;\n" @@ -149,7 +150,7 @@ " \tohci->it_context_list = kcalloc(ohci->n_it,\n" " \t\t\t\t\tsizeof(*ohci->it_context_list),\n" " \t\t\t\t\tGFP_KERNEL);\n" - "-\tif (ohci->it_context_list = NULL || ohci->ir_context_list = NULL) {\n" + "-\tif (ohci->it_context_list == NULL || ohci->ir_context_list == NULL) {\n" "+\tif (!ohci->it_context_list || !ohci->ir_context_list) {\n" " \t\terr = -ENOMEM;\n" " \t\tgoto fail_contexts;\n" @@ -157,4 +158,4 @@ "-- \n" 2.12.2 -ed309c0c8537dc2eb61a4582b8ab7b1817c1ae51802ada17eeb021556875941c +0f25473d494990f8e26a7d14ffd595c5d5cd0143dd601df14696a00a29aadc80
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.