Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161377805
D5591.id14219.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D5591.id14219.diff
View Options
Index: head/sys/mips/cavium/octeon_ebt3000_cf.c
===================================================================
--- head/sys/mips/cavium/octeon_ebt3000_cf.c
+++ head/sys/mips/cavium/octeon_ebt3000_cf.c
@@ -215,37 +215,38 @@
* the bio struct.
*/
- if(bp->bio_cmd & BIO_GETATTR) {
+ switch (bp->bio_cmd) {
+ case BIO_GETATTR:
if (g_handleattr_int(bp, "GEOM::fwsectors", cf_priv->drive_param.sec_track))
return;
if (g_handleattr_int(bp, "GEOM::fwheads", cf_priv->drive_param.heads))
return;
g_io_deliver(bp, ENOIOCTL);
return;
- }
-
- if ((bp->bio_cmd & (BIO_READ | BIO_WRITE))) {
- if (bp->bio_cmd & BIO_READ) {
- error = cf_cmd_read(bp->bio_length / cf_priv->drive_param.sector_size,
- bp->bio_offset / cf_priv->drive_param.sector_size, bp->bio_data);
- } else if (bp->bio_cmd & BIO_WRITE) {
- error = cf_cmd_write(bp->bio_length / cf_priv->drive_param.sector_size,
- bp->bio_offset/cf_priv->drive_param.sector_size, bp->bio_data);
- } else {
- printf("%s: unrecognized bio_cmd %x.\n", __func__, bp->bio_cmd);
- error = ENOTSUP;
- }
+ case BIO_READ:
+ error = cf_cmd_read(bp->bio_length / cf_priv->drive_param.sector_size,
+ bp->bio_offset / cf_priv->drive_param.sector_size, bp->bio_data);
+ break;
+ case BIO_WRITE:
+ error = cf_cmd_write(bp->bio_length / cf_priv->drive_param.sector_size,
+ bp->bio_offset/cf_priv->drive_param.sector_size, bp->bio_data);
+ break;
- if (error != 0) {
- g_io_deliver(bp, error);
- return;
- }
+ default:
+ printf("%s: unrecognized bio_cmd %x.\n", __func__, bp->bio_cmd);
+ error = ENOTSUP;
+ break;
+ }
- bp->bio_resid = 0;
- bp->bio_completed = bp->bio_length;
- g_io_deliver(bp, 0);
+ if (error != 0) {
+ g_io_deliver(bp, error);
+ return;
}
+
+ bp->bio_resid = 0;
+ bp->bio_completed = bp->bio_length;
+ g_io_deliver(bp, 0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 4, 6:35 AM (20 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34650782
Default Alt Text
D5591.id14219.diff (1 KB)
Attached To
Mode
D5591: Don't assume that bio_cmd is a bitfield.
Attached
Detach File
Event Timeline
Log In to Comment