block: sed-opal: add token for OPAL_LIFECYCLE
authorDavid Kozub <zub@linux.fjfi.cvut.cz>
Thu, 14 Feb 2019 00:16:03 +0000 (01:16 +0100)
committerJens Axboe <axboe@kernel.dk>
Sat, 6 Apr 2019 17:09:13 +0000 (11:09 -0600)
Define OPAL_LIFECYCLE token and use it instead of literals in
get_lsp_lifecycle.

Acked-by: Jon Derrick <jonathan.derrick@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Scott Bauer <sbauer@plzdonthack.me>
Signed-off-by: David Kozub <zub@linux.fjfi.cvut.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/opal_proto.h
block/sed-opal.c

index e20be82588542918a0440ddc9bb1bde1d5bf5f8b..b6e352cfe982b3d0ee905eef308b54771802f7b2 100644 (file)
@@ -170,6 +170,8 @@ enum opal_token {
        OPAL_READLOCKED = 0x07,
        OPAL_WRITELOCKED = 0x08,
        OPAL_ACTIVEKEY = 0x0A,
+       /* lockingsp table */
+       OPAL_LIFECYCLE = 0x06,
        /* locking info table */
        OPAL_MAXRANGES = 0x04,
         /* mbr control */
index ad66d1dc725a447fba9dad33c0923d71f878de09..7f02e50e2bce1cadcbb2df178fb3500e68213c4c 100644 (file)
@@ -1786,12 +1786,12 @@ static int get_lsp_lifecycle(struct opal_dev *dev, void *data)
 
        add_token_u8(&err, dev, OPAL_STARTNAME);
        add_token_u8(&err, dev, 3); /* Start Column */
-       add_token_u8(&err, dev, 6); /* Lifecycle Column */
+       add_token_u8(&err, dev, OPAL_LIFECYCLE);
        add_token_u8(&err, dev, OPAL_ENDNAME);
 
        add_token_u8(&err, dev, OPAL_STARTNAME);
        add_token_u8(&err, dev, 4); /* End Column */
-       add_token_u8(&err, dev, 6); /* Lifecycle Column */
+       add_token_u8(&err, dev, OPAL_LIFECYCLE);
        add_token_u8(&err, dev, OPAL_ENDNAME);
 
        add_token_u8(&err, dev, OPAL_ENDLIST);