Skip to contentSkip to conversation

floppy: remove duplicated flag FD_RAW_NEED_DISK

PATCH In review Fengguang Wu 3 participants 3 messages Jul 28, 2012 – Jul 31, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 floppy: remove duplicated flag FD_RAW_NEED_DISK

Fix coccinelle warning (without behavior change):

drivers/block/floppy.c:2518:32-48: duplicated argument to & or |

---

drivers/block/floppy.c +1 -2
index 553f43a..0fcbe14 100644
@@ -2516,8 +2516,7 @@ static int make_raw_rw_request(void)
 	set_fdc((long)current_req->rq_disk->private_data);
 
 	raw_cmd = &default_raw_cmd;
-	raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_DISK | FD_RAW_NEED_DISK |
-	    FD_RAW_NEED_SEEK;
+	raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_DISK | FD_RAW_NEED_SEEK;
 	raw_cmd->cmd_count = NR_RW;
 	if (rq_data_dir(current_req) == READ) {
 		raw_cmd->flags |= FD_RAW_READ;
#1 lore raw
Quoted 1 line · Fengguang Wu

FD_RAW_NEED_DISK | FD_RAW_NEED_DISK

That's a pretty old defect from kernel 1.1 days.

#2 lore raw
In reply to Fengguang Wu
Quoted 12 lines · Fengguang Wu

Fix coccinelle warning (without behavior change):

drivers/block/floppy.c:2518:32-48: duplicated argument to & or |

---

drivers/block/floppy.c +0 -0
index 553f43a..0fcbe14 100644

drivers/block/floppy.c static int make_raw_rw_request(void) · line 2522

Quoted 9 lines
drivers/block/floppy.c +1 -2
@@ -2516,8 +2516,7 @@ static int make_raw_rw_request(void)
 	set_fdc((long)current_req->rq_disk->private_data);
 
 	raw_cmd = &default_raw_cmd;
-	raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_DISK | FD_RAW_NEED_DISK |
-	    FD_RAW_NEED_SEEK;
+	raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_DISK | FD_RAW_NEED_SEEK;
 	raw_cmd->cmd_count = NR_RW;
 	if (rq_data_dir(current_req) == READ) {
 		raw_cmd->flags |= FD_RAW_READ;

Now that's a funny one. Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs