All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] samples: bpf: fix style in bpf_load
@ 2019-05-23  7:24 Daniel T. Lee
  2019-05-24  0:40 ` Y Song
  2019-05-28  9:28 ` Daniel Borkmann
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel T. Lee @ 2019-05-23  7:24 UTC (permalink / raw)
  To: Daniel Borkmann, Alexei Starovoitov; +Cc: netdev

This commit fixes style problem in samples/bpf/bpf_load.c

Styles that have been changed are:
 - Magic string use of 'DEBUGFS'
 - Useless zero initialization of a global variable
 - Minor style fix with whitespace

Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
---
Changes in v2:
  - Fix string concatenation from build-time to compile-time.

 samples/bpf/bpf_load.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c
index eae7b635343d..1734ade04f7f 100644
--- a/samples/bpf/bpf_load.c
+++ b/samples/bpf/bpf_load.c
@@ -40,7 +40,7 @@ int prog_cnt;
 int prog_array_fd = -1;
 
 struct bpf_map_data map_data[MAX_MAPS];
-int map_data_count = 0;
+int map_data_count;
 
 static int populate_prog_array(const char *event, int prog_fd)
 {
@@ -65,7 +65,7 @@ static int write_kprobe_events(const char *val)
 	else
 		flags = O_WRONLY | O_APPEND;
 
-	fd = open("/sys/kernel/debug/tracing/kprobe_events", flags);
+	fd = open(DEBUGFS "kprobe_events", flags);
 
 	ret = write(fd, val, strlen(val));
 	close(fd);
@@ -490,8 +490,8 @@ static int load_elf_maps_section(struct bpf_map_data *maps, int maps_shndx,
 
 		/* Verify no newer features were requested */
 		if (validate_zero) {
-			addr = (unsigned char*) def + map_sz_copy;
-			end  = (unsigned char*) def + map_sz_elf;
+			addr = (unsigned char *) def + map_sz_copy;
+			end  = (unsigned char *) def + map_sz_elf;
 			for (; addr < end; addr++) {
 				if (*addr != 0) {
 					free(sym);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] samples: bpf: fix style in bpf_load
  2019-05-23  7:24 [PATCH v2] samples: bpf: fix style in bpf_load Daniel T. Lee
@ 2019-05-24  0:40 ` Y Song
  2019-05-28  9:28 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Y Song @ 2019-05-24  0:40 UTC (permalink / raw)
  To: Daniel T. Lee; +Cc: Daniel Borkmann, Alexei Starovoitov, netdev

On Thu, May 23, 2019 at 12:26 AM Daniel T. Lee <danieltimlee@gmail.com> wrote:
>
> This commit fixes style problem in samples/bpf/bpf_load.c
>
> Styles that have been changed are:
>  - Magic string use of 'DEBUGFS'
>  - Useless zero initialization of a global variable
>  - Minor style fix with whitespace
>
> Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>

Acked-by: Yonghong Song <yhs@fb.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] samples: bpf: fix style in bpf_load
  2019-05-23  7:24 [PATCH v2] samples: bpf: fix style in bpf_load Daniel T. Lee
  2019-05-24  0:40 ` Y Song
@ 2019-05-28  9:28 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2019-05-28  9:28 UTC (permalink / raw)
  To: Daniel T. Lee, Alexei Starovoitov; +Cc: netdev

On 05/23/2019 09:24 AM, Daniel T. Lee wrote:
> This commit fixes style problem in samples/bpf/bpf_load.c
> 
> Styles that have been changed are:
>  - Magic string use of 'DEBUGFS'
>  - Useless zero initialization of a global variable
>  - Minor style fix with whitespace
> 
> Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>

Applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-28  9:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23  7:24 [PATCH v2] samples: bpf: fix style in bpf_load Daniel T. Lee
2019-05-24  0:40 ` Y Song
2019-05-28  9:28 ` Daniel Borkmann

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.