[PATCH] kernel:bpf Remove structure passing and assignment to save stack and no coping structures

2018-01-17 Thread Karim Eshapa
>On Sun, Jan 14, 2018 at 01:18:35PM +0200, Karim Eshapa wrote: >> >> Use pointers to structure as arguments to function instead of coping >> >> structures and less stack size. Also transfer TNUM(_v, _m) to >> >> tnum.h file to be used in differnet files f

[PATCH] kernel:bpf Remove structure passing and assignment to save stack and no coping structures

2018-01-14 Thread Karim Eshapa
>> Use pointers to structure as arguments to function instead of coping >> structures and less stack size. Also transfer TNUM(_v, _m) to >> tnum.h file to be used in differnet files for creating anonymous structures >> statically. >> >> Signed-off-by:

[PATCH] kernel:bpf Remove structure passing and assignment to save stack and no coping structures

2018-01-13 Thread Karim Eshapa
Use pointers to structure as arguments to function instead of coping structures and less stack size. Also transfer TNUM(_v, _m) to tnum.h file to be used in differnet files for creating anonymous structures statically. Signed-off-by: Karim Eshapa <karim.esh...@gmail.com> Thanks,

[PATCH] Remove structure passing and assignment to save stack and no coping structures.

2018-01-13 Thread Karim Eshapa
Signed-off-by: Karim Eshapa <karim.esh...@gmail.com> Thanks, Karim --- include/linux/tnum.h | 2 +- kernel/bpf/tnum.c | 13 +++-- kernel/bpf/verifier.c | 12 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/include/linux/tnum.h b/include/linux/

[PATCH] Remove structure passing and assignment to save stack and no coping structures.

2018-01-13 Thread Karim Eshapa
Signed-off-by: Karim Eshapa <karim.esh...@gmail.com> Thanks, Karim --- include/linux/tnum.h | 2 +- kernel/bpf/tnum.c | 13 +++-- kernel/bpf/verifier.c | 12 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/include/linux/tnum.h b/include/linux/

bpf: Change structure passing and assignment

2018-01-13 Thread Karim Eshapa
I noticed that most of functions here have structure arguements and return structure, all these structures passed and returned are delt in passing and assignment like memcpy a structure.In addition it takes size in stack while passing. so why not we use pointers to structure as argumentsor

RE: [PATCH] drivers: net: wimax: i2400m: i2400m-usb: Use time_after for time comparison

2017-05-08 Thread Karim Eshapa
Use time_after() for time comparison with the new fix. Signed-off-by: Karim Eshapa <karim.esh...@gmail.com> --- drivers/net/wimax/i2400m/i2400m-usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wimax/i2400m/i2400m-usb.h b/drivers/net/wimax/i2400m/i2400m

[PATCH] drivers: net: wireless: rsi: rsi_91x_core: Use time_after time comparison

2017-05-08 Thread Karim Eshapa
Use time_after kernel macro for time comparison. Signed-off-by: Karim Eshapa <karim.esh...@gmail.com> --- drivers/net/wireless/rsi/rsi_91x_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_core.c b/drivers/net/wireless/rsi/rsi_91x_

[PATCH] drivers: net: wimax: i2400m: i2400m-usb: Use time_after for time comparison

2017-05-08 Thread Karim Eshapa
cast timeframe variable with (unsigned long) then use time_after() kernel macro for time comparison. Signed-off-by: Karim Eshapa <karim.esh...@gmail.com> --- drivers/net/wimax/i2400m/i2400m-usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wimax/i2400m/

[PATCH] benet: Use time_before_eq for time comparison

2017-05-01 Thread Karim Eshapa
Use time_before_eq for time comparison more safe and dealing with timer wrapping to be future-proof. Signed-off-by: Karim Eshapa <karim.esh...@gmail.com> --- drivers/net/ethernet/emulex/benet/be_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/et

[PATCH] drivers:net:ethernet:emulex:benet: Use time_before_eq for time comparison

2017-04-27 Thread Karim Eshapa
Use time_before_eq for time comparison more safe and dealing with timer wrapping to be future-proof. Signed-off-by: Karim Eshapa <kaim.esh...@gmail.com> --- drivers/net/ethernet/emulex/benet/be_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/et

RE:PATCH drivers:net:cris/eth_v10: alternate string char arrary

2017-04-24 Thread Karim Eshapa
On Mon, 24 Apr 2017 14:18:58 -0400 (EDT), David Miller wrote: > Mon, 24 Apr 2017 19:49:39 +0200, Karim Eshapa wrote: >> >> static char pointer creates two variables in final assembly. >> static string and pointer to it according to >> Jeff Garzik janitors TODO. &

PATCH drivers:net:cris/eth_v10: alternate string char arrary

2017-04-24 Thread Karim Eshapa
static char pointer creates two variables in final assembly. static string and pointer to it according to Jeff Garzik janitors TODO. Signed-off-by: Karim Eshapa <karim.esh...@gmail.com> --- drivers/net/cris/eth_v10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drive

RE:drivers:net:ethernet:adi:bfin_mac: Use FIELD_SIZEOF defined kernel macro

2017-04-23 Thread Karim Eshapa
On Sun, 23 Apr 2017 22:56:38 +0200, Geert Uytterhoeven: >IMHO this makes the code less safe and less future-proof. >What if the type of info is ever changed? >There's no safety check to validate that the FIELD_SIZEOF() operates on the >same data as the strlcpy() destination. Really make sense :)

[PATCH 1/1] drivers:net:ethernet:adi:bfin_mac: Use FIELD_SIZEOF defined kernel macro

2017-04-23 Thread Karim Eshapa
Use FIELD_SIZEOF defined kernel macro kernel.h Signed-off-by: Karim Eshapa <karim.esh...@gmail.com> --- drivers/net/ethernet/adi/bfin_mac.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/adi/bfin_mac.c b/drivers/net/ethern

[PATCH 2/2] drivers:net:ethernet:3com:3c512: array char instead of char pointer

2017-04-21 Thread Karim Eshapa
char pointer creates two variables static string and pointer to it according to Jeff Garzik janitors TODO Signed-off-by: Karim Eshapa <karim.esh...@gmail.com> --- drivers/net/ethernet/3com/3c515.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/3com