]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - block/sed-opal.c
blk-mq: don't queue more if we get a busy return
[mirror_ubuntu-bionic-kernel.git] / block / sed-opal.c
index 9ed51d0c6b1d171fc2eab785ef854b64f93721fe..c64011cda9fcc65b6179dd349d9778cec93feba5 100644 (file)
@@ -877,7 +877,7 @@ static size_t response_get_string(const struct parsed_resp *resp, int n,
                return 0;
        }
 
-       if (n > resp->num) {
+       if (n >= resp->num) {
                pr_debug("Response has %d tokens. Can't access %d\n",
                         resp->num, n);
                return 0;
@@ -899,7 +899,7 @@ static u64 response_get_u64(const struct parsed_resp *resp, int n)
                return 0;
        }
 
-       if (n > resp->num) {
+       if (n >= resp->num) {
                pr_debug("Response has %d tokens. Can't access %d\n",
                         resp->num, n);
                return 0;
@@ -2078,13 +2078,16 @@ static int opal_erase_locking_range(struct opal_dev *dev,
 static int opal_enable_disable_shadow_mbr(struct opal_dev *dev,
                                          struct opal_mbr_data *opal_mbr)
 {
+       u8 enable_disable = opal_mbr->enable_disable == OPAL_MBR_ENABLE ?
+               OPAL_TRUE : OPAL_FALSE;
+
        const struct opal_step mbr_steps[] = {
                { opal_discovery0, },
                { start_admin1LSP_opal_session, &opal_mbr->key },
-               { set_mbr_done, &opal_mbr->enable_disable },
+               { set_mbr_done, &enable_disable },
                { end_opal_session, },
                { start_admin1LSP_opal_session, &opal_mbr->key },
-               { set_mbr_enable_disable, &opal_mbr->enable_disable },
+               { set_mbr_enable_disable, &enable_disable },
                { end_opal_session, },
                { NULL, }
        };
@@ -2204,7 +2207,7 @@ static int __opal_lock_unlock(struct opal_dev *dev,
 
 static int __opal_set_mbr_done(struct opal_dev *dev, struct opal_key *key)
 {
-       u8 mbr_done_tf = 1;
+       u8 mbr_done_tf = OPAL_TRUE;
        const struct opal_step mbrdone_step [] = {
                { opal_discovery0, },
                { start_admin1LSP_opal_session, key },