Re: [mips-sjhill:mips-for-linux-next 58/62] arch/mips/kernel/uprobes.c:304:15: error: variable or field 'kstart' declared void

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Sep 24, 2016 at 02:06:11AM +0800, kbuild test robot wrote:

> From: kbuild test robot <fengguang.wu@xxxxxxxxx>
> To: James Hogan <james.hogan@xxxxxxxxxx>
> Cc: kbuild-all@xxxxxx, linux-mips@xxxxxxxxxxxxxx, Ralf Baechle
>  <ralf@xxxxxxxxxxxxxx>
> Subject: [mips-sjhill:mips-for-linux-next 58/62]
>  arch/mips/kernel/uprobes.c:304:15: error: variable or field 'kstart'
>  declared void
> Content-Type: multipart/mixed; boundary="5mCyUwZo2JvN/JJP"
> 
> tree:   git://git.linux-mips.org/pub/scm/sjhill/linux-sjhill.git mips-for-linux-next
> head:   3cd97a2d95ac84bf17d4d538960d3e17585a791c
> commit: a0b7ccb92e7b57f3c4cf5bf8a875fe7ecf00fe2c [58/62] MIPS: uprobes: Flush icache via kernel address
> config: mips-allmodconfig (attached as .config)
> compiler: mips-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
> reproduce:
>         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         git checkout a0b7ccb92e7b57f3c4cf5bf8a875fe7ecf00fe2c
>         # save the attached .config to linux build tree
>         make.cross ARCH=mips 
> 
> All error/warnings (new ones prefixed by >>):
> 
>    arch/mips/kernel/uprobes.c: In function 'arch_uprobe_copy_ixol':
> >> arch/mips/kernel/uprobes.c:304:15: error: variable or field 'kstart' declared void
>      void *kaddr, kstart;
>                   ^~~~~~
> >> arch/mips/kernel/uprobes.c:308:9: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
>      kstart = kaddr + (vaddr & ~PAGE_MASK);
>             ^
> >> arch/mips/kernel/uprobes.c:309:9: warning: passing argument 1 of 'memcpy' makes pointer from integer without a cast [-Wint-conversion]
>      memcpy(kstart, src, len);
>             ^~~~~~
>    In file included from include/linux/string.h:18:0,
>                     from include/linux/bitmap.h:8,
>                     from include/linux/cpumask.h:11,
>                     from arch/mips/include/asm/processor.h:15,
>                     from arch/mips/include/asm/thread_info.h:15,
>                     from include/linux/thread_info.h:54,
>                     from include/asm-generic/preempt.h:4,
>                     from ./arch/mips/include/generated/asm/preempt.h:1,
>                     from include/linux/preempt.h:59,
>                     from include/linux/spinlock.h:50,
>                     from include/linux/wait.h:8,
>                     from include/linux/fs.h:5,
>                     from include/linux/highmem.h:4,
>                     from arch/mips/kernel/uprobes.c:1:
>    arch/mips/include/asm/string.h:138:14: note: expected 'void *' but argument is of type 'int'
>     extern void *memcpy(void *__to, __const__ void *__from, size_t __n);
>                  ^~~~~~
> 
> vim +/kstart +304 arch/mips/kernel/uprobes.c
> 
>    298				*(uprobe_opcode_t *)&auprobe->orig_inst[0].word);
>    299	}
>    300	
>    301	void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
>    302					  void *src, unsigned long len)
>    303	{
>  > 304		void *kaddr, kstart;
>    305	
>    306		/* Initialize the slot */
>    307		kaddr = kmap_atomic(page);
>  > 308		kstart = kaddr + (vaddr & ~PAGE_MASK);
>  > 309		memcpy(kstart, src, len);
>    310		flush_icache_range(kstart, kstart + len);
>    311		kunmap_atomic(kaddr);
>    312	}

Something like below patch should do the trick.  James?

  Ralf

Signed-off-by: Ralf Baechle <ralf@xxxxxxxxxxxxxx>

 arch/mips/kernel/uprobes.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kernel/uprobes.c b/arch/mips/kernel/uprobes.c
index 9a507ab..a896417 100644
--- a/arch/mips/kernel/uprobes.c
+++ b/arch/mips/kernel/uprobes.c
@@ -301,14 +301,14 @@ int set_orig_insn(struct arch_uprobe *auprobe, struct mm_struct *mm,
 void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
 				  void *src, unsigned long len)
 {
-	void *kaddr, kstart;
+	unsigned long kaddr, kstart;
 
 	/* Initialize the slot */
-	kaddr = kmap_atomic(page);
+	kaddr = (unsigned long)kmap_atomic(page);
 	kstart = kaddr + (vaddr & ~PAGE_MASK);
-	memcpy(kstart, src, len);
+	memcpy((void *)kstart, src, len);
 	flush_icache_range(kstart, kstart + len);
-	kunmap_atomic(kaddr);
+	kunmap_atomic((void *)kaddr);
 }
 
 /**




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux