linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata: fix sparse warnings
@ 2005-12-26  3:34 Randy.Dunlap
  2006-01-18  0:40 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Randy.Dunlap @ 2005-12-26  3:34 UTC (permalink / raw)
  To: linux-ide; +Cc: jgarzik

From: Randy Dunlap <rdunlap@xenotime.net>

Question:  in patch block 2, what are the semantics of the user <arg>?
Does it point to an input u8 args[4] which must be immediately followed
by an output u8 args[4]?  That's what it seems to be.  Just checking.


Fix sparse warnings:
drivers/scsi/libata-scsi.c:154:15: warning: cast removes address space of expression
drivers/scsi/libata-scsi.c:204:20: warning: cast removes address space of expression
drivers/scsi/libata-scsi.c:204:20: warning: incorrect type in argument 1 (different address spaces)
drivers/scsi/libata-scsi.c:204:20:    expected void [noderef] *to<asn:1>
drivers/scsi/libata-scsi.c:204:20:    got void *<noident>
drivers/scsi/libata-scsi.c:231:15: warning: cast removes address space of expression

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
---
 drivers/scsi/libata-scsi.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

--- linux-2615-rc7.orig/drivers/scsi/libata-scsi.c
+++ linux-2615-rc7/drivers/scsi/libata-scsi.c
@@ -151,7 +151,7 @@ int ata_cmd_ioctl(struct scsi_device *sc
 	struct scsi_sense_hdr sshdr;
 	enum dma_data_direction data_dir;
 
-	if (NULL == (void *)arg)
+	if (arg == NULL)
 		return -EINVAL;
 
 	if (copy_from_user(args, arg, sizeof(args)))
@@ -201,7 +201,7 @@ int ata_cmd_ioctl(struct scsi_device *sc
 	/* Need code to retrieve data from check condition? */
 
 	if ((argbuf)
-	 && copy_to_user((void *)(arg + sizeof(args)), argbuf, argsize))
+	 && copy_to_user(arg + sizeof(args), argbuf, argsize))
 		rc = -EFAULT;
 error:
 	if (argbuf)
@@ -228,7 +228,7 @@ int ata_task_ioctl(struct scsi_device *s
 	u8 args[7];
 	struct scsi_sense_hdr sshdr;
 
-	if (NULL == (void *)arg)
+	if (arg == NULL)
 		return -EINVAL;
 
 	if (copy_from_user(args, arg, sizeof(args)))


---

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] libata: fix sparse warnings
  2005-12-26  3:34 [PATCH] libata: fix sparse warnings Randy.Dunlap
@ 2006-01-18  0:40 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2006-01-18  0:40 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: linux-ide

Randy.Dunlap wrote:
> From: Randy Dunlap <rdunlap@xenotime.net>
> 
> Question:  in patch block 2, what are the semantics of the user <arg>?
> Does it point to an input u8 args[4] which must be immediately followed
> by an output u8 args[4]?  That's what it seems to be.  Just checking.
> 
> 
> Fix sparse warnings:
> drivers/scsi/libata-scsi.c:154:15: warning: cast removes address space of expression
> drivers/scsi/libata-scsi.c:204:20: warning: cast removes address space of expression
> drivers/scsi/libata-scsi.c:204:20: warning: incorrect type in argument 1 (different address spaces)
> drivers/scsi/libata-scsi.c:204:20:    expected void [noderef] *to<asn:1>
> drivers/scsi/libata-scsi.c:204:20:    got void *<noident>
> drivers/scsi/libata-scsi.c:231:15: warning: cast removes address space of expression

Can you resend this and any other non-ACPI patches you have pending, please?

	Jeff




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-01-18  0:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-26  3:34 [PATCH] libata: fix sparse warnings Randy.Dunlap
2006-01-18  0:40 ` Jeff Garzik

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).