OSDN Git Service

drbd: fix duplicate array initializer
authorArnd Bergmann <arnd@arndb.de>
Wed, 6 Apr 2022 19:07:09 +0000 (21:07 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Apr 2022 01:54:24 +0000 (19:54 -0600)
There are two initializers for P_RETRY_WRITE:

drivers/block/drbd/drbd_main.c:3676:22: warning: initialized field overwritten [-Woverride-init]

Remove the first one since it was already ignored by the compiler
and reorder the list to match the enum definition. As P_ZEROES had
no entry, add that one instead.

Fixes: 036b17eaab93 ("drbd: Receiving part for the PROTOCOL_UPDATE packet")
Fixes: f31e583aa2c2 ("drbd: introduce P_ZEROES (REQ_OP_WRITE_ZEROES on the "wire")")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Link: https://lore.kernel.org/r/20220406190715.1938174-2-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/drbd/drbd_main.c

index 912560f..2887350 100644 (file)
@@ -3581,9 +3581,8 @@ const char *cmdname(enum drbd_packet cmd)
         * when we want to support more than
         * one PRO_VERSION */
        static const char *cmdnames[] = {
+
                [P_DATA]                = "Data",
-               [P_WSAME]               = "WriteSame",
-               [P_TRIM]                = "Trim",
                [P_DATA_REPLY]          = "DataReply",
                [P_RS_DATA_REPLY]       = "RSDataReply",
                [P_BARRIER]             = "Barrier",
@@ -3594,7 +3593,6 @@ const char *cmdname(enum drbd_packet cmd)
                [P_DATA_REQUEST]        = "DataRequest",
                [P_RS_DATA_REQUEST]     = "RSDataRequest",
                [P_SYNC_PARAM]          = "SyncParam",
-               [P_SYNC_PARAM89]        = "SyncParam89",
                [P_PROTOCOL]            = "ReportProtocol",
                [P_UUIDS]               = "ReportUUIDs",
                [P_SIZES]               = "ReportSizes",
@@ -3602,6 +3600,7 @@ const char *cmdname(enum drbd_packet cmd)
                [P_SYNC_UUID]           = "ReportSyncUUID",
                [P_AUTH_CHALLENGE]      = "AuthChallenge",
                [P_AUTH_RESPONSE]       = "AuthResponse",
+               [P_STATE_CHG_REQ]       = "StateChgRequest",
                [P_PING]                = "Ping",
                [P_PING_ACK]            = "PingAck",
                [P_RECV_ACK]            = "RecvAck",
@@ -3612,23 +3611,25 @@ const char *cmdname(enum drbd_packet cmd)
                [P_NEG_DREPLY]          = "NegDReply",
                [P_NEG_RS_DREPLY]       = "NegRSDReply",
                [P_BARRIER_ACK]         = "BarrierAck",
-               [P_STATE_CHG_REQ]       = "StateChgRequest",
                [P_STATE_CHG_REPLY]     = "StateChgReply",
                [P_OV_REQUEST]          = "OVRequest",
                [P_OV_REPLY]            = "OVReply",
                [P_OV_RESULT]           = "OVResult",
                [P_CSUM_RS_REQUEST]     = "CsumRSRequest",
                [P_RS_IS_IN_SYNC]       = "CsumRSIsInSync",
+               [P_SYNC_PARAM89]        = "SyncParam89",
                [P_COMPRESSED_BITMAP]   = "CBitmap",
                [P_DELAY_PROBE]         = "DelayProbe",
                [P_OUT_OF_SYNC]         = "OutOfSync",
-               [P_RETRY_WRITE]         = "RetryWrite",
                [P_RS_CANCEL]           = "RSCancel",
                [P_CONN_ST_CHG_REQ]     = "conn_st_chg_req",
                [P_CONN_ST_CHG_REPLY]   = "conn_st_chg_reply",
                [P_PROTOCOL_UPDATE]     = "protocol_update",
+               [P_TRIM]                = "Trim",
                [P_RS_THIN_REQ]         = "rs_thin_req",
                [P_RS_DEALLOCATED]      = "rs_deallocated",
+               [P_WSAME]               = "WriteSame",
+               [P_ZEROES]              = "Zeroes",
 
                /* enum drbd_packet, but not commands - obsoleted flags:
                 *      P_MAY_IGNORE