Re: [PATCH] selftests/powerpc: Fix strncpy usage

2018-06-22 Thread Segher Boessenkool
Hi! On Fri, Jun 22, 2018 at 11:43:44AM -0300, Breno Leitao wrote: > On 06/21/2018 08:18 PM, Segher Boessenkool wrote: > > On Wed, Jun 20, 2018 at 07:51:11PM -0300, Breno Leitao wrote: > >> - strncpy(prog, argv[0], strlen(argv[0])); > >> + strncpy(prog, argv[0], sizeof(prog) - 1); > > > > st

Re: [PATCH] selftests/powerpc: Fix strncpy usage

2018-06-22 Thread Segher Boessenkool
On Fri, Jun 22, 2018 at 04:51:21PM +0200, Christophe LEROY wrote: > Le 22/06/2018 à 16:43, Breno Leitao a écrit : > >+ fprintf(stderr, "Very big executable name: %s\n", argv[0]); > >+ return 1; > >+ } > >+ > >+ strncpy(prog, argv[0], sizeof(prog) - 1); > > Y

Re: [PATCH] selftests/powerpc: Fix strncpy usage

2018-06-22 Thread Al Dunsmuir
On Friday, June 22, 2018, 11:15:29 AM, Paul Clarke wrote: > On 06/22/2018 09:43 AM, Breno Leitao wrote: >> If you don't mind, I would solve this problem slightly different, as it seems >> to be more readable. >> >> - strncpy(prog, argv[0], strlen(argv[0])); >> + if (strlen(argv[0]) >=

[PATCH] powerpc/mm: remove warning about ‘type’ being set

2018-06-22 Thread Mathieu Malaterre
‘type’ is only used when CONFIG_DEBUG_HIGHMEM is set. So add a possibly unused tag to variable. Remove warning treated as error with W=1: arch/powerpc/mm/highmem.c:59:6: error: variable ‘type’ set but not used [-Werror=unused-but-set-variable] Signed-off-by: Mathieu Malaterre --- arch/powerp

[PATCH] powerpc/xmon: avoid warnings about variables that might be clobbered by ‘longjmp’

2018-06-22 Thread Mathieu Malaterre
Move initialization of variables after data definitions. This silence warnings treated as error with W=1: arch/powerpc/xmon/xmon.c:3389:14: error: variable ‘name’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered] arch/powerpc/xmon/xmon.c:3100:22: error: variable ‘tsk’ might be cl

[PATCH] powerpc: include setup.h header file to fix warnings

2018-06-22 Thread Mathieu Malaterre
Make sure to include setup.h to provide the following prototypes: - irqstack_early_init - setup_power_save - initialize_cache_info Fix the following warnings (treated as error in W=1): arch/powerpc/kernel/setup_32.c:198:13: error: no previous prototype for ‘irqstack_early_init’ [-Werror=missi

Re: [PATCH 2/2] powerpc: Document issues with TM on POWER9

2018-06-22 Thread Segher Boessenkool
On Fri, Jun 22, 2018 at 04:14:52PM +1000, Michael Neuling wrote: > +degredation. Host userspace has TM disabled "degradation" > +POWER9C DD1.2 and above are only avaliable with POWERNV and hence "available" Segher

Re: [PATCH 1/2] powerpc: Document issues with the DAWR on POWER9

2018-06-22 Thread Segher Boessenkool
On Fri, Jun 22, 2018 at 04:14:51PM +1000, Michael Neuling wrote: > +will accept the command. Unfortunatley since there is no hardware "unfortunately". > +speed since it can use the hardware emualation. Unfortnatley if this It is not your favourite word to type ;-) Segher

Re: [PATCH] powerpc/mm: fix always true/false warning in slice.c

2018-06-22 Thread Christophe LEROY
Le 22/06/2018 à 16:55, Mathieu Malaterre a écrit : On Fri, Jun 22, 2018 at 3:49 PM Christophe Leroy wrote: This patch fixes the following warnings (obtained with make W=1). arch/powerpc/mm/slice.c: In function 'slice_range_to_mask': arch/powerpc/mm/slice.c:73:12: error: comparison is alway

Re: [PATCH] selftests/powerpc: Fix strncpy usage

2018-06-22 Thread Paul Clarke
On 06/22/2018 09:43 AM, Breno Leitao wrote: > If you don't mind, I would solve this problem slightly different, as it seems > to be more readable. > > - strncpy(prog, argv[0], strlen(argv[0])); > + if (strlen(argv[0]) >= LEN_MAX){ > + fprintf(stderr, "Very big executable

Re: [PATCH] powerpc/mm: fix always true/false warning in slice.c

2018-06-22 Thread Mathieu Malaterre
On Fri, Jun 22, 2018 at 3:49 PM Christophe Leroy wrote: > > This patch fixes the following warnings (obtained with make W=1). > > arch/powerpc/mm/slice.c: In function 'slice_range_to_mask': > arch/powerpc/mm/slice.c:73:12: error: comparison is always true due to > limited range of data type [-Wer

Re: [PATCH] selftests/powerpc: Fix strncpy usage

2018-06-22 Thread Christophe LEROY
Le 22/06/2018 à 16:43, Breno Leitao a écrit : Hi Segher, On 06/21/2018 08:18 PM, Segher Boessenkool wrote: On Wed, Jun 20, 2018 at 07:51:11PM -0300, Breno Leitao wrote: - strncpy(prog, argv[0], strlen(argv[0])); + strncpy(prog, argv[0], sizeof(prog) - 1); strncpy(prog,

Re: [PATCH] selftests/powerpc: Fix strncpy usage

2018-06-22 Thread Breno Leitao
Hi Segher, On 06/21/2018 08:18 PM, Segher Boessenkool wrote: > On Wed, Jun 20, 2018 at 07:51:11PM -0300, Breno Leitao wrote: >> -strncpy(prog, argv[0], strlen(argv[0])); >> +strncpy(prog, argv[0], sizeof(prog) - 1); > > strncpy(prog, argv[0], sizeof prog); > if (prog[sizeof pr

[PATCH] powerpc/mm: fix always true/false warning in slice.c

2018-06-22 Thread Christophe Leroy
This patch fixes the following warnings (obtained with make W=1). arch/powerpc/mm/slice.c: In function 'slice_range_to_mask': arch/powerpc/mm/slice.c:73:12: error: comparison is always true due to limited range of data type [-Werror=type-limits] if (start < SLICE_LOW_TOP) { ^ arch/p

[PATCH] powerpc/mm: fix missing prototypes in slice.c

2018-06-22 Thread Christophe Leroy
This patch fixes the following warnings (obtained with make W=1). arch/powerpc/mm/slice.c: At top level: arch/powerpc/mm/slice.c:682:15: error: no previous prototype for 'arch_get_unmapped_area' [-Werror=missing-prototypes] unsigned long arch_get_unmapped_area(struct file *filp, ^

Re: [PATCH v2 07/19] powerpc/powermac: Make some functions static

2018-06-22 Thread Mathieu Malaterre
This one should also be good to go. On Wed, Mar 28, 2018 at 9:39 PM Mathieu Malaterre wrote: > > These functions can all be static, make it so. Fix warnings treated as > errors with W=1: > > arch/powerpc/platforms/powermac/pci.c:1022:6: error: no previous prototype > for ‘pmac_pci_fixup_ohci’

Re: [PATCH 16/19] powerpc/powermac: Add missing include of header pmac.h

2018-06-22 Thread Mathieu Malaterre
This one is also ok. On Thu, Mar 22, 2018 at 9:21 PM Mathieu Malaterre wrote: > > The header `pmac.h` was not included, leading to the following warnings, > treated as error with W=1: > > arch/powerpc/platforms/powermac/time.c:69:13: error: no previous prototype > for ‘pmac_time_init’ [-Werror

Re: [PATCH v3 03/19] powerpc: Move `path` variable inside DEBUG_PROM

2018-06-22 Thread Mathieu Malaterre
This one should be ok. On Wed, Apr 4, 2018 at 10:08 PM Mathieu Malaterre wrote: > > Add gcc attribute unused for two variables. Fix warnings treated as errors > with W=1: > > arch/powerpc/kernel/prom_init.c:1388:8: error: variable ‘path’ set but not > used [-Werror=unused-but-set-variable] > >

Re: [PATCH v2 02/19] powerpc/powermac: Mark variable x as unused

2018-06-22 Thread Mathieu Malaterre
On Thu, Mar 29, 2018 at 6:09 PM LEROY Christophe wrote: > > Mathieu Malaterre a écrit : > > > Since the value of x is never intended to be read, remove it. Fix warning > > treated as error with W=1: > > > > arch/powerpc/platforms/powermac/udbg_scc.c:76:9: error: variable > > ‘x’ set but not use

Re: [PATCH 2/3] [v2] m68k: mac: use time64_t in RTC handling

2018-06-22 Thread Arnd Bergmann
On Fri, Jun 22, 2018 at 7:26 AM, Finn Thain wrote: > On Tue, 19 Jun 2018, Arnd Bergmann wrote: > >> The real-time clock on m68k (and powerpc) mac systems uses an unsigned >> 32-bit value starting in 1904, which overflows in 2040, about two years >> later than everyone else, but this gets wrapped a

Re: [PATCH] ocxl: Fix page fault handler in case of fault on dying process

2018-06-22 Thread Andrew Donnellan
On 18/06/18 22:14, Frederic Barrat wrote: If a process exits without doing proper cleanup, there's a window where an opencapi device can try to access the memory of the dying process and may trigger a page fault. That's an expected scenario and the ocxl driver holds a reference on the mm_struct o

Re: [PATCH v3] powerpc/32: Remove left over function prototypes

2018-06-22 Thread Mathieu Malaterre
On Thu, Jun 21, 2018 at 1:27 PM Michael Ellerman wrote: > > Mathieu Malaterre writes: > > > In commit 4aea909eeba3 ("powerpc: Add missing prototypes in setup_32.c") > > I don't have that commit ^ ? > > That might be because I squashed some of your fixes together or something? I am doing an awful

Re: [PATCH 2/2] powerpc: Document issues with TM on POWER9

2018-06-22 Thread Stewart Smith
Michael Neuling writes: > +POWER9C DD1.2 and above are only avaliable with POWERNV and hence PowerVM, not POWERNV -- Stewart Smith OPAL Architect, IBM.

Re: [PATCH 1/2] powerpc: Document issues with the DAWR on POWER9

2018-06-22 Thread Stewart Smith
Michael Neuling writes: > Signed-off-by: Michael Neuling > --- > Documentation/powerpc/DAWR-POWER9.txt | 58 +++ > 1 file changed, 58 insertions(+) > create mode 100644 Documentation/powerpc/DAWR-POWER9.txt Acked-by: Stewart Smith -- Stewart Smith OPAL Architect, IBM