+ idetape-gcc-41-warning-fix.patch added to -mm tree

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

 



The patch titled

     idetape gcc 4.1 warning fix

has been added to the -mm tree.  Its filename is

     idetape-gcc-41-warning-fix.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this


From: Daniel Walker <dwalker@xxxxxxxxxx>

drivers/ide/ide-tape.c: In function â??idetape_copy_stage_from_userâ??:
drivers/ide/ide-tape.c:2662: warning: ignoring return value of â??copy_from_userâ??, declared with attribute warn_unused_result
drivers/ide/ide-tape.c: In function â??idetape_copy_stage_to_userâ??:
drivers/ide/ide-tape.c:2689: warning: ignoring return value of â??copy_to_userâ??, declared with attribute warn_unused_result

Signed-off-by: Daniel Walker <dwalker@xxxxxxxxxx>
Cc: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@xxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/ide/ide-tape.c |   44 +++++++++++++++++++++++++++------------
 1 files changed, 31 insertions(+), 13 deletions(-)

diff -puN drivers/ide/ide-tape.c~idetape-gcc-41-warning-fix drivers/ide/ide-tape.c
--- devel/drivers/ide/ide-tape.c~idetape-gcc-41-warning-fix	2006-05-11 10:13:16.000000000 -0700
+++ devel-akpm/drivers/ide/ide-tape.c	2006-05-11 10:15:57.000000000 -0700
@@ -2646,7 +2646,8 @@ static idetape_stage_t *idetape_kmalloc_
 	return __idetape_kmalloc_stage(tape, 0, 0);
 }
 
-static void idetape_copy_stage_from_user (idetape_tape_t *tape, idetape_stage_t *stage, const char __user *buf, int n)
+static int idetape_copy_stage_from_user(idetape_tape_t *tape,
+			idetape_stage_t *stage, const char __user *buf, int n)
 {
 	struct idetape_bh *bh = tape->bh;
 	int count;
@@ -2656,11 +2657,14 @@ static void idetape_copy_stage_from_user
 		if (bh == NULL) {
 			printk(KERN_ERR "ide-tape: bh == NULL in "
 				"idetape_copy_stage_from_user\n");
-			return;
+			return 1;
 		}
 #endif /* IDETAPE_DEBUG_BUGS */
-		count = min((unsigned int)(bh->b_size - atomic_read(&bh->b_count)), (unsigned int)n);
-		copy_from_user(bh->b_data + atomic_read(&bh->b_count), buf, count);
+		count = min((unsigned int)(bh->b_size -
+				atomic_read(&bh->b_count)), (unsigned int)n);
+		if (copy_from_user(bh->b_data + atomic_read(&bh->b_count),
+					buf, count))
+			return 1;
 		n -= count;
 		atomic_add(count, &bh->b_count);
 		buf += count;
@@ -2671,9 +2675,11 @@ static void idetape_copy_stage_from_user
 		}
 	}
 	tape->bh = bh;
+	return 0;
 }
 
-static void idetape_copy_stage_to_user (idetape_tape_t *tape, char __user *buf, idetape_stage_t *stage, int n)
+static int idetape_copy_stage_to_user(idetape_tape_t *tape, char __user *buf,
+					idetape_stage_t *stage, int n)
 {
 	struct idetape_bh *bh = tape->bh;
 	int count;
@@ -2683,11 +2689,12 @@ static void idetape_copy_stage_to_user (
 		if (bh == NULL) {
 			printk(KERN_ERR "ide-tape: bh == NULL in "
 				"idetape_copy_stage_to_user\n");
-			return;
+			return 1;
 		}
 #endif /* IDETAPE_DEBUG_BUGS */
 		count = min(tape->b_count, n);
-		copy_to_user(buf, tape->b_data, count);
+		if  (copy_to_user(buf, tape->b_data, count))
+			return 1;
 		n -= count;
 		tape->b_data += count;
 		tape->b_count -= count;
@@ -2700,6 +2707,7 @@ static void idetape_copy_stage_to_user (
 			}
 		}
 	}
+	return 0;
 }
 
 static void idetape_init_merge_stage (idetape_tape_t *tape)
@@ -3737,7 +3745,8 @@ static ssize_t idetape_chrdev_read (stru
 		return (0);
 	if (tape->merge_stage_size) {
 		actually_read = min((unsigned int)(tape->merge_stage_size), (unsigned int)count);
-		idetape_copy_stage_to_user(tape, buf, tape->merge_stage, actually_read);
+		if (idetape_copy_stage_to_user(tape, buf, tape->merge_stage, actually_read))
+			return -EFAULT;
 		buf += actually_read;
 		tape->merge_stage_size -= actually_read;
 		count -= actually_read;
@@ -3746,7 +3755,9 @@ static ssize_t idetape_chrdev_read (stru
 		bytes_read = idetape_add_chrdev_read_request(drive, tape->capabilities.ctl);
 		if (bytes_read <= 0)
 			goto finish;
-		idetape_copy_stage_to_user(tape, buf, tape->merge_stage, bytes_read);
+		if (idetape_copy_stage_to_user(tape, buf,
+					tape->merge_stage, bytes_read))
+			return -EFAULT;
 		buf += bytes_read;
 		count -= bytes_read;
 		actually_read += bytes_read;
@@ -3756,7 +3767,9 @@ static ssize_t idetape_chrdev_read (stru
 		if (bytes_read <= 0)
 			goto finish;
 		temp = min((unsigned long)count, (unsigned long)bytes_read);
-		idetape_copy_stage_to_user(tape, buf, tape->merge_stage, temp);
+		if (idetape_copy_stage_to_user(tape, buf,
+					tape->merge_stage, temp))
+			return -EFAULT;
 		actually_read += temp;
 		tape->merge_stage_size = bytes_read-temp;
 	}
@@ -3834,7 +3847,9 @@ static ssize_t idetape_chrdev_write (str
 		}
 #endif /* IDETAPE_DEBUG_BUGS */
 		actually_written = min((unsigned int)(tape->stage_size - tape->merge_stage_size), (unsigned int)count);
-		idetape_copy_stage_from_user(tape, tape->merge_stage, buf, actually_written);
+		if (idetape_copy_stage_from_user(tape, tape->merge_stage,
+				buf, actually_written))
+			return -EFAULT;
 		buf += actually_written;
 		tape->merge_stage_size += actually_written;
 		count -= actually_written;
@@ -3847,7 +3862,9 @@ static ssize_t idetape_chrdev_write (str
 		}
 	}
 	while (count >= tape->stage_size) {
-		idetape_copy_stage_from_user(tape, tape->merge_stage, buf, tape->stage_size);
+		if (idetape_copy_stage_from_user(tape, tape->merge_stage,
+				buf, tape->stage_size))
+			return -EFAULT;
 		buf += tape->stage_size;
 		count -= tape->stage_size;
 		retval = idetape_add_chrdev_write_request(drive, tape->capabilities.ctl);
@@ -3857,7 +3874,8 @@ static ssize_t idetape_chrdev_write (str
 	}
 	if (count) {
 		actually_written += count;
-		idetape_copy_stage_from_user(tape, tape->merge_stage, buf, count);
+		if (idetape_copy_stage_from_user(tape, tape->merge_stage, buf, count))
+			return -EFAULT;
 		tape->merge_stage_size += count;
 	}
 	return (actually_written);
_

Patches currently in -mm which might be from dwalker@xxxxxxxxxx are

tpm_register_hardware-gcc-41-warning-fix.patch
git-net.patch
megaraid-gcc-41-warning-fix.patch
invert-irq-migrationc-brach-prediction.patch
idetape-gcc-41-warning-fix.patch
profile-likely-unlikely-macros.patch
profile-likely-unlikely-macros-tidy.patch
profile-likely-unlikely-macros-fix.patch
profile-likely-unlikely-macros-fix-2.patch
fix-gcc-3x-w-likely-profiling.patch

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

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux