From 1d66729a0afcdeffe88b6e00d638fdada1ead22d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20S=C3=A6b=C3=B8?= Date: Wed, 6 Apr 2022 14:55:09 +0200 Subject: [PATCH] Bluetooth: Audio: Remove zero-ing of variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit dc812539b81a ("Bluetooth: MPL: Fix use of uninitialized command.param value") fixed the use of a potentially un-initialized variable, by - splitting a log statement, so that the variable is only logged (=used) if in use (and therefore hopefully also initialized) - setting the variable to zero if not in use The second part is not required, as all other code in the module checks whether the variable is in use before using it. And this second part also prevents the parent struct from being made 'const'. This commits removes the zeroing of the variable, so that the struct can be made 'const'. Signed-off-by: Asbjørn Sæbø --- subsys/bluetooth/audio/mpl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/subsys/bluetooth/audio/mpl.c b/subsys/bluetooth/audio/mpl.c index e470d84536f..009e6592a45 100644 --- a/subsys/bluetooth/audio/mpl.c +++ b/subsys/bluetooth/audio/mpl.c @@ -2589,7 +2589,6 @@ void send_command(struct mpl_cmd command) if (command.use_param) { BT_DBG("opcode: %d, param: %d", command.opcode, command.param); } else { - command.param = 0; /* ensure that is set to 0 if not used */ BT_DBG("opcode: %d", command.opcode); }