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


Groups > linux.kernel > #1460163 > unrolled thread

[PATCH 2/2] scripts/sortextable: set the variable mmap_failure

Started byManinder Singh <maninder1.s@samsung.com>
First post2016-08-11 06:30 +0200
Last post2016-08-11 09:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 2/2] scripts/sortextable: set the variable mmap_failure Maninder Singh <maninder1.s@samsung.com> - 2016-08-11 06:30 +0200
    Re: [PATCH 2/2] scripts/sortextable: set the variable mmap_failure Borislav Petkov <bp@suse.de> - 2016-08-11 09:10 +0200

#1460163 — [PATCH 2/2] scripts/sortextable: set the variable mmap_failure

FromManinder Singh <maninder1.s@samsung.com>
Date2016-08-11 06:30 +0200
Subject[PATCH 2/2] scripts/sortextable: set the variable mmap_failure
Message-ID<s4PMZ-6rC-3@gated-at.bofh.it>
Currently mmap_failed variable is 1 for every case, so make it 0
if mmap is success.

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Vaneet Narang <v.narang@samsung.com>
---
 scripts/sortextable.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/sortextable.c b/scripts/sortextable.c
index 30b4e7c..0b6a31b 100644
--- a/scripts/sortextable.c
+++ b/scripts/sortextable.c
@@ -106,6 +106,7 @@ static void *mmap_file(char const *fname)
 	}
 	addr = mmap(0, sb.st_size, PROT_READ|PROT_WRITE, MAP_SHARED,
 		    fd_map, 0);
+	mmap_failed = 0;
 	if (addr == MAP_FAILED) {
 		mmap_failed = 1;
 		fprintf(stderr, "Could not mmap file: %s\n", fname);
-- 
1.7.9.5

[toc] | [next] | [standalone]


#1460206

FromBorislav Petkov <bp@suse.de>
Date2016-08-11 09:10 +0200
Message-ID<s4ShP-8tK-11@gated-at.bofh.it>
In reply to#1460163
On Thu, Aug 11, 2016 at 09:52:55AM +0530, Maninder Singh wrote:
> Currently mmap_failed variable is 1 for every case, so make it 0
> if mmap is success.
> 
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> Signed-off-by: Vaneet Narang <v.narang@samsung.com>

See section 11) of Documentation/SubmittingPatches on how the sign-off
chain should be done.

It is not clear from your current submission what Vaneet's role is in
the creation of this patch is. Ditto for your other patch.

> ---
>  scripts/sortextable.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/sortextable.c b/scripts/sortextable.c
> index 30b4e7c..0b6a31b 100644
> --- a/scripts/sortextable.c
> +++ b/scripts/sortextable.c
> @@ -106,6 +106,7 @@ static void *mmap_file(char const *fname)
>  	}
>  	addr = mmap(0, sb.st_size, PROT_READ|PROT_WRITE, MAP_SHARED,
>  		    fd_map, 0);
> +	mmap_failed = 0;

This mmap_failed thing looks like a disaster. It is only needed so
that we know to do munmap() but munmap() works even if the range is
not mapped so you probably could go and remove that mmap_failed thing
altogether.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web