mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/3] i2o: Delete the '64bit fix' comments from __i2o_cfg_passthru()
Date: Thu, 06 Nov 2014 03:27:05 +0000	[thread overview]
Message-ID: <1415244425.3398.49.camel@decadent.org.uk> (raw)
In-Reply-To: <1415244281.3398.46.camel@decadent.org.uk>

[-- Attachment #1: Type: text/plain, Size: 2678 bytes --]

We can't fix an API that is broken by definition.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/message/i2o/i2o_config.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
index f9a10a8..7529fa1 100644
--- a/drivers/message/i2o/i2o_config.c
+++ b/drivers/message/i2o/i2o_config.c
@@ -522,6 +522,11 @@ static int i2o_cfg_evt_get(unsigned long arg, struct file *fp)
 }
 
 #ifdef CONFIG_I2O_EXT_ADAPTEC
+
+/*
+ * Note: The ioctl is defined to use struct sg_single_element, which
+ * limits it to 32-bit user virtual addresses even on 64-bit systems.
+ */
 static int __i2o_cfg_passthru(unsigned int iop, u32 __user *user_msg)
 {
 	struct i2o_controller *c;
@@ -597,7 +602,6 @@ static int __i2o_cfg_passthru(unsigned int iop, u32 __user *user_msg)
 			rcode = -EFAULT;
 			goto cleanup;
 		}
-		// TODO 64bit fix
 		sg = (struct sg_simple_element *)((&msg->u.head[0]) +
 						  sg_offset);
 		sg_count =
@@ -635,7 +639,6 @@ static int __i2o_cfg_passthru(unsigned int iop, u32 __user *user_msg)
 			/* Copy in the user's SG buffer if necessary */
 			if (sg[i].
 			    flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) {
-				// TODO 64bit fix
 				if (copy_from_user
 				    (p->virt,
 				     (void __user *)(unsigned long)sg[i].
@@ -647,7 +650,6 @@ static int __i2o_cfg_passthru(unsigned int iop, u32 __user *user_msg)
 					goto sg_list_cleanup;
 				}
 			}
-			//TODO 64bit fix
 			sg[i].addr_bus = (u32) p->phys;
 		}
 	}
@@ -663,7 +665,6 @@ static int __i2o_cfg_passthru(unsigned int iop, u32 __user *user_msg)
 		u32 rmsg[I2O_OUTBOUND_MSG_FRAME_SIZE];
 		/* Copy back the Scatter Gather buffers back to user space */
 		u32 j;
-		// TODO 64bit fix
 		struct sg_simple_element *sg;
 		int sg_size;
 
@@ -689,7 +690,6 @@ static int __i2o_cfg_passthru(unsigned int iop, u32 __user *user_msg)
 		sg_count =
 		    (size - sg_offset * 4) / sizeof(struct sg_simple_element);
 
-		// TODO 64bit fix
 		sg = (struct sg_simple_element *)(rmsg + sg_offset);
 		for (j = 0; j < sg_count; j++) {
 			/* Copy out the SG list to user's buffer if necessary */
@@ -697,7 +697,6 @@ static int __i2o_cfg_passthru(unsigned int iop, u32 __user *user_msg)
 			    (sg[j].
 			     flag_count & 0x4000000 /*I2O_SGL_FLAGS_DIR */ )) {
 				sg_size = sg[j].flag_count & 0xffffff;
-				// TODO 64bit fix
 				if (copy_to_user
 				    ((void __user *)(unsigned long)sg[j].addr_bus,
 				     sg_list[j].virt, sg_size)) {

-- 
Ben Hutchings
Beware of programmers who carry screwdrivers. - Leonard Brandwein

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

      parent reply	other threads:[~2014-11-06  3:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06  3:24 [PATCH 0/3] i2o: I2OPASSTHRU fix and cleanup Ben Hutchings
2014-11-06  3:25 ` [PATCH 1/3] i2o: Fix DMA mapping leak in failure path of i2o_cfg_passthru32() Ben Hutchings
2014-11-06  3:26 ` [PATCH 2/3] i2o: Define i2o_cfg_passthru() and i2o_cfg_passthru32() consistently Ben Hutchings
2014-11-06  3:27 ` Ben Hutchings [this message]

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=1415244425.3398.49.camel@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®