SCSI vs MN10300: Can get_user() be given an array?

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

 



The MN10300 arch is throwing up an error in the SCSI driver and I'm not sure
whether it needs fixing in the arch - in get_user() - or in the SCSI code.

The problem is this line in sg_scsi_ioctl():

	if (get_user(opcode, sic->data))

sic points to the following struct:

	typedef struct scsi_ioctl_command {
		unsigned int inlen;
		unsigned int outlen;
		unsigned char data[0];
	} Scsi_Ioctl_Command;

However, __get_user_check() on MN10300 does this:

	const __typeof__(ptr) __guc_ptr = (ptr);

which fails with:

	block/scsi_ioctl.c:450: error: invalid initializer

The question is what is SCSI actually asking get_user() to do?  As far as I
can tell, gcc thinks that it's being askied to declare some sort of array
here.

Should the SCSI driver be changed to:

	if (get_user(opcode, (unsigned char *)sic->data))

or should the MN10300 arch be changed to morph the array into a pointer,
perhaps with:

	const __typeof__(ptr[0])* __guc_ptr = (ptr);

or:

	const __typeof__(*ptr)* __guc_ptr = (ptr);

David
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux