linux/drivers/misc
Frank Haverkamp 58d66ce732 GenWQE: Fix endian issues detected by sparse
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 08:45:50 -08:00
..
altera-stapl Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2011-10-31 15:42:54 -07:00
c2port c2port: convert class code to use bin_attrs in groups 2013-07-24 15:39:05 -07:00
carma Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2013-11-20 13:20:24 -08:00
cb710 mmc: cb710: drop free_irq for devm_request_irq allocated irq 2013-09-26 13:55:30 -07:00
eeprom misc: eeprom_93xx46: remove unnecessary spi_set_drvdata() 2013-12-04 20:23:51 -08:00
genwqe GenWQE: Fix endian issues detected by sparse 2013-12-20 08:45:50 -08:00
ibmasm misc: ibmasm: remove unnecessary pci_set_drvdata() 2013-09-26 09:13:54 -07:00
lis3lv02d misc: replace strict_strtoul() with kstrtoul() 2013-06-06 12:54:08 -07:00
mei mei: me: set dma mask using DMA mapping API 2013-12-18 16:39:54 -08:00
mic Merge 3.13-rc4 into char-misc-next 2013-12-16 16:11:28 -08:00
sgi-gru drivers/misc/sgi-gru/grufault.c: fix a sanity test in gru_set_context_option() 2013-07-03 16:07:42 -07:00
sgi-xp sgi: xpc: Convert use of typedef ctl_table to struct ctl_table 2013-06-14 10:19:25 +02:00
ti-st drivers/misc/ti-st: Prefer tty_driver_flush_buffer 2013-12-04 20:23:51 -08:00
vmw_vmci vmw_vmci: Convert driver to use get_user_pages_fast() 2013-10-05 18:04:55 -07:00
ad525x_dpot-i2c.c misc: remove use of __devexit 2012-11-21 12:53:32 -08:00
ad525x_dpot-spi.c misc: remove use of __devexit 2012-11-21 12:53:32 -08:00
ad525x_dpot.c drivers: misc: Mark functions as static in ad525x_dpot.c 2013-12-18 16:41:52 -08:00
ad525x_dpot.h Merge branch 'char-misc-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc 2012-01-09 12:08:59 -08:00
apds990x.c misc: replace strict_strtoul() with kstrtoul() 2013-06-06 12:54:08 -07:00
apds9802als.c misc: replace strict_strtoul() with kstrtoul() 2013-06-06 12:54:08 -07:00
arm-charlcd.c misc: arm-charlcd: remove deprecated IRQF_DISABLED 2013-10-16 12:36:10 -07:00
atmel_pwm.c misc: atmel_pwm: add deferred-probing support 2013-10-29 16:22:57 -07:00
atmel_tclib.c ARM: at91/tc/clocksource: Add 32 bit variant to Timer Counter 2012-03-01 13:38:49 +01:00
atmel-ssc.c Merge 3.11-rc3 into char-misc-next. 2013-07-29 11:50:17 -07:00
bh1770glc.c misc: replace strict_strtoul() with kstrtoul() 2013-06-06 12:54:08 -07:00
bh1780gli.c misc: bh1780: probe from compatible string 2013-10-03 16:02:35 -07:00
bmp085-i2c.c misc: bmp085: Clean up and enable use of interrupt for completion. 2013-12-04 20:23:51 -08:00
bmp085-spi.c misc: bmp085: Clean up and enable use of interrupt for completion. 2013-12-04 20:23:51 -08:00
bmp085.c misc: bmp085: Clean up and enable use of interrupt for completion. 2013-12-04 20:23:51 -08:00
bmp085.h misc: bmp085: Clean up and enable use of interrupt for completion. 2013-12-04 20:23:51 -08:00
cs5535-mfgpt.c cs5535-mfgpt: Fix quotation marks 2013-04-03 11:23:13 -07:00
ds1682.c MISC: convert drivers/misc/* to use module_i2c_driver() 2012-01-24 16:31:49 -08:00
dummy-irq.c treewide: Fix typo in printk 2013-05-28 12:02:13 +02:00
enclosure.c [SCSI] enclosure: fix WARN_ON in dual path device removing 2013-12-02 11:13:14 -08:00
fsa9480.c misc: fsa8480: Use dev_pm_ops 2013-04-11 12:39:02 -07:00
hmc6352.c misc: replace strict_strtoul() with kstrtoul() 2013-06-06 12:54:08 -07:00
hpilo.c drivers/misc/hpilo: Correct panic when an AUX iLO is detected 2013-08-14 14:46:22 -07:00
hpilo.h misc: hpilo: increase number of max supported channels 2012-06-14 17:22:12 -07:00
ics932s401.c hwmon: Change my email address. 2013-08-27 08:28:01 -07:00
ioc4.c misc: remove use of __devexit 2012-11-21 12:53:32 -08:00
isl29003.c misc: replace strict_strtoul() with kstrtoul() 2013-06-06 12:54:08 -07:00
isl29020.c misc: replace strict_strtoul() with kstrtoul() 2013-06-06 12:54:08 -07:00
Kconfig GenWQE Enable driver 2013-12-18 16:51:15 -08:00
kgdbts.c kgdb/kgdbts: support ppc64 2013-03-02 08:52:17 -06:00
lattice-ecp3-config.c treewide: Fix typo in printk 2013-05-28 12:02:13 +02:00
lkdtm.c drivers: misc: Mark function jp_generic_ide_ioctl() as static in lkdtm.c 2013-12-18 16:41:52 -08:00
Makefile GenWQE Enable driver 2013-12-18 16:51:15 -08:00
pch_phub.c pch_phub: fix error return code in pch_phub_probe() 2013-06-06 12:54:08 -07:00
phantom.c misc: phantom: remove deprecated IRQF_DISABLED 2013-10-16 12:36:10 -07:00
pti.c misc: pti: remove unnecessary pci_set_drvdata() 2013-09-26 09:13:54 -07:00
spear13xx_pcie_gadget.c misc: replace strict_strtoul() with kstrtoul() 2013-06-06 12:54:08 -07:00
sram.c misc: sram: fix error path in sram_probe 2013-07-24 22:54:50 -07:00
ti_dac7512.c drivers: misc: ti_dac7512: add support for DT matching 2013-09-26 09:04:06 -07:00
tifm_7xx1.c tifm: fix error return code in tifm_7xx1_probe() 2013-10-30 10:19:30 -07:00
tifm_core.c tifm: convert bus code to use dev_groups 2013-10-16 18:40:58 -07:00
tsl2550.c Drivers: Misc: tsl2250: fix warnings, unsigned long will never < 0 2013-05-16 18:11:12 -07:00
vmw_balloon.c misc: vmw_balloon: Remove braces to fix build for clang. 2013-08-27 21:51:21 -07:00