linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Frank Haverkamp <haver@linux.vnet.ibm.com>
Cc: fengguang.wu@intel.com, jim.epost@gmail.com,
	sfr@canb.auug.org.au, linux-next@vger.kernel.org,
	linux-kernel@vger.kernel.org, kbuild-all@01.org
Subject: Re: [PATCH 1/2] GenWQE: Fix endian issues detected by sparse
Date: Fri, 20 Dec 2013 08:47:05 -0800	[thread overview]
Message-ID: <20131220164705.GA24804@kroah.com> (raw)
In-Reply-To: <1387553171-31469-1-git-send-email-haver@linux.vnet.ibm.com>

On Fri, Dec 20, 2013 at 04:26:10PM +0100, Frank Haverkamp wrote:
> Fengguang Wu used CF=-D__CHECK_ENDIAN__ to check the GenWQE driver for
> endian issues. Sparse found a couple of those. Most of them were caused
> by not correctly handling __be64/32 and __u64/32. Those I was able to
> fix with appropriate castings.
> 
> One more serious issue was the ATS entry in struct genwqe_ddcb_cmd.
> The kernel expected it in big-endian, but the type was defined __u64.
> I decided that it is better to keep the interface consistent using
> host endian byte-odering instead of having a mixture. With this change
> the kernel likes to see host endian byte order for the ATS entry. That
> would have been an interface change, if someone would have used the
> driver already. Since this is not the case, I hope it is ok to fix it
> now.
> 
> For the genqwe_readq/writeq/readl/writel functions I enforced the casts.
> 
> It still complains, as far as I can see, about some copy_to/from_user()
> usages:
> 
>   CHECK   char-misc/drivers/misc/genwqe/card_dev.c
> char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
> char-misc/arch/x86/include/asm/uaccess.h:625:18:    expected void *<noident>
> char-misc/arch/x86/include/asm/uaccess.h:625:18:    got void const *from
> char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
> char-misc/arch/x86/include/asm/uaccess.h:625:18:    expected void *<noident>
> char-misc/arch/x86/include/asm/uaccess.h:625:18:    got void const *from
> char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
> char-misc/arch/x86/include/asm/uaccess.h:625:18:    expected void *<noident>
> char-misc/arch/x86/include/asm/uaccess.h:625:18:    got void const *from
> char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
> char-misc/arch/x86/include/asm/uaccess.h:625:18:    expected void *<noident>
> char-misc/arch/x86/include/asm/uaccess.h:625:18:    got void const *from
>   CC [M]  drivers/misc/genwqe/card_dev.o
>   CHECK   char-misc/drivers/misc/genwqe/card_ddcb.c
> char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
> char-misc/arch/x86/include/asm/uaccess.h:625:18:    expected void *<noident>
> char-misc/arch/x86/include/asm/uaccess.h:625:18:    got void const *from
> char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
> char-misc/arch/x86/include/asm/uaccess.h:625:18:    expected void *<noident>
> char-misc/arch/x86/include/asm/uaccess.h:625:18:    got void const *from
>   CC [M]  drivers/misc/genwqe/card_ddcb.o
>   LD [M]  drivers/misc/genwqe/genwqe_card.o
> 
> I appreciate some help from you to figure out what is causig those, and
> making a proposal how to fix them.
> 
> I included the missing header file to fix the
> implicit-function-declaration warning when using dynamic_hex_dump.
> 
> Signed-off-by: Frank Haverkamp <haver@linux.vnet.ibm.com>

In the future (I missed this as well), please use a "Reported-by:" tag
to document who reported the problem to you.

thanks,

greg k-h

  reply	other threads:[~2013-12-20 16:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-20 14:17 randconfig build error with next-20131220, in drivers/misc/genwqe/genwqe_driver.h Jim Davis
2013-12-20 15:26 ` [PATCH 1/2] GenWQE: Fix endian issues detected by sparse Frank Haverkamp
2013-12-20 16:47   ` Greg KH [this message]
2013-12-20 19:12   ` Frank Haverkamp
2013-12-20 19:27     ` [PATCH] GenWQE: Accidently casting to u32 where u64 is required Frank Haverkamp
2014-01-07  6:41   ` [PATCH 1/2] GenWQE: Fix endian issues detected by sparse Dan Carpenter
2014-01-07 12:30     ` Frank Haverkamp
2014-01-07 12:45       ` Dan Carpenter
2014-01-07 14:39         ` Frank Haverkamp
2014-01-07 14:41           ` [PATCH 1/3] GenWQE: Rework return code for flash-update ioctl Frank Haverkamp
2014-01-07 14:41           ` [PATCH 2/3] GenWQE: Fix compile problems for Alpha Frank Haverkamp
2014-01-07 14:41           ` [PATCH 3/3] GenWQE: Fix warnings for sparc Frank Haverkamp
2013-12-20 15:26 ` [PATCH 2/2] GenWQE: Replace dynamic_hex_dump with print_hex_dump_debug Frank Haverkamp
2013-12-20 15:33   ` Greg KH
2013-12-20 15:49     ` Frank Haverkamp
2013-12-20 15:55       ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131220164705.GA24804@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=fengguang.wu@intel.com \
    --cc=haver@linux.vnet.ibm.com \
    --cc=jim.epost@gmail.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).