Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1639332 > unrolled thread

[PATCH 0/2] alpha-module: Adjustments for module_frob_arch_sections()

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-05-11 14:00 +0200
Last post2017-05-11 14:00 +0200
Articles 3 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/2] alpha-module: Adjustments for module_frob_arch_sections() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-11 14:00 +0200
    [PATCH 2/2] alpha-module: Delete an error message for a failed memory  allocation in module_frob_arch_sections() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-11 14:00 +0200
    [PATCH 1/2] alpha-module: Improve a size determination in  module_frob_arch_sections() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-11 14:00 +0200

#1639332 — [PATCH 0/2] alpha-module: Adjustments for module_frob_arch_sections()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-05-11 14:00 +0200
Subject[PATCH 0/2] alpha-module: Adjustments for module_frob_arch_sections()
Message-ID<tFUVc-5Qu-7@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 11 May 2017 13:11:23 +0200

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
  Improve a size determination
  Delete an error message for a failed memory allocation

 arch/alpha/kernel/module.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

-- 
2.12.3

[toc] | [next] | [standalone]


#1639338 — [PATCH 2/2] alpha-module: Delete an error message for a failed memory allocation in module_frob_arch_sections()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-05-11 14:00 +0200
Subject[PATCH 2/2] alpha-module: Delete an error message for a failed memory allocation in module_frob_arch_sections()
Message-ID<tFUVc-5Qu-25@gated-at.bofh.it>
In reply to#1639332
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 11 May 2017 13:00:34 +0200

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/alpha/kernel/module.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c
index 387d9c500e48..211e62e9a0af 100644
--- a/arch/alpha/kernel/module.c
+++ b/arch/alpha/kernel/module.c
@@ -109,9 +109,5 @@ module_frob_arch_sections(Elf64_Ehdr *hdr, Elf64_Shdr *sechdrs,
-	if (!chains) {
-		printk(KERN_ERR
-		       "module %s: no memory for symbol chain buffer\n",
-		       me->name);
+	if (!chains)
 		return -ENOMEM;
-	}
 
 	got->sh_size = 0;
 	got->sh_addralign = 8;
-- 
2.12.3

[toc] | [prev] | [next] | [standalone]


#1639339 — [PATCH 1/2] alpha-module: Improve a size determination in module_frob_arch_sections()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-05-11 14:00 +0200
Subject[PATCH 1/2] alpha-module: Improve a size determination in module_frob_arch_sections()
Message-ID<tFUVc-5Qu-27@gated-at.bofh.it>
In reply to#1639332
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 11 May 2017 12:54:29 +0200

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/alpha/kernel/module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c
index 936bc8f89a67..387d9c500e48 100644
--- a/arch/alpha/kernel/module.c
+++ b/arch/alpha/kernel/module.c
@@ -105,5 +105,5 @@ module_frob_arch_sections(Elf64_Ehdr *hdr, Elf64_Shdr *sechdrs,
 	}
 
 	nsyms = symtab->sh_size / sizeof(Elf64_Sym);
-	chains = kcalloc(nsyms, sizeof(struct got_entry), GFP_KERNEL);
+	chains = kcalloc(nsyms, sizeof(*chains), GFP_KERNEL);
 	if (!chains) {
-- 
2.12.3

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web