Re: [PATCH 1/2] ide: ide-tape.c sparse annotations and unaligned access removal

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

 



On Wed, 2008-07-16 at 19:43 +0200, Bartlomiej Zolnierkiewicz wrote:
> On Tuesday 15 July 2008, Harvey Harrison wrote:
> > If this is actually unaligned the access of speed/max_speed above
> > is already broken and needs a get_unaligned.  Otherwise it is
> > aligned and they can be removed.
> > 
> > Signed-off-by: Harvey Harrison <harvey.harrison@xxxxxxxxx>
> > ---
> > Bart, if this truly should be unaligned, let me know and I'll send you
> > a patch fixing the speed/maxspeed issue.
> 
> I applied the patch as it is for now as I don't see a reason to
> use unaligned access there but I could have forgotten some details
> (added Borislav to cc:).
> 
> I've also noticed that there are some put_unaligned()-s left in
> idetape_get_mode_sense_results(), is this intended?

I just fixed the immediate ones I saw right below the aligned access to 
speed/max_speed.  I can't be sure about tape->caps being aligned or not,
but at least the following incremental patch is ok if caps is 2-byte
aligned.  Feel free to fold it into my original or put my signed-off by on
a new commit.

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 40b09b2..9c3ce71 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -2392,12 +2392,12 @@ static void idetape_get_mode_sense_results(ide_drive_t *drive)
 	if (!speed) {
 		printk(KERN_INFO "ide-tape: %s: invalid tape speed "
 				"(assuming 650KB/sec)\n", drive->name);
-		put_unaligned(650, (u16 *)&caps[14]);
+		*(u16 *)&caps[14] = 650;
 	}
 	if (!max_speed) {
 		printk(KERN_INFO "ide-tape: %s: invalid max_speed "
 				"(assuming 650KB/sec)\n", drive->name);
-		put_unaligned(650, (u16 *)&caps[8]);
+		*(u16 *)&caps[8] = 650;
 	}
 
 	memcpy(&tape->caps, caps, 20);


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

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux