Skip to content

Commit 79f105d

Browse files
de-nordiccarlescufi
authored andcommitted
mgmt/mcumgr: Drop zst_ prefix from smp_transport members
With dropping the zephyr_ prefix, the member prefix zst_ makes no sense. Signed-off-by: Dominik Ermel <[email protected]>
1 parent 77fc356 commit 79f105d

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

include/zephyr/mgmt/mcumgr/smp.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ typedef void zephyr_smp_transport_ud_free_fn(void *ud);
8484
*/
8585
struct smp_transport {
8686
/* Must be the first member. */
87-
struct k_work zst_work;
87+
struct k_work work;
8888

8989
/* FIFO containing incoming requests to be processed. */
90-
struct k_fifo zst_fifo;
90+
struct k_fifo fifo;
9191

92-
smp_transport_out_fn zst_output;
93-
smp_transport_get_mtu_fn zst_get_mtu;
94-
smp_transport_ud_copy_fn zst_ud_copy;
95-
smp_transport_ud_free_fn zst_ud_free;
92+
smp_transport_out_fn output;
93+
smp_transport_get_mtu_fn get_mtu;
94+
smp_transport_ud_copy_fn ud_copy;
95+
smp_transport_ud_free_fn ud_free;
9696

9797
#ifdef CONFIG_MCUMGR_SMP_REASSEMBLY
9898
/* Packet reassembly internal data, API access only */

subsys/mgmt/mcumgr/lib/smp/src/smp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ smp_on_err(struct smp_streamer *streamer, const struct mgmt_hdr *req_hdr,
228228
/* Build and transmit the error response. */
229229
rc = smp_build_err_rsp(streamer, req_hdr, status, rsn);
230230
if (rc == 0) {
231-
streamer->smpt->zst_output(rsp);
231+
streamer->smpt->output(rsp);
232232
rsp = NULL;
233233
}
234234

@@ -306,7 +306,7 @@ smp_process_request_packet(struct smp_streamer *streamer, void *vreq)
306306
}
307307

308308
/* Send the response. */
309-
rc = streamer->smpt->zst_output(rsp);
309+
rc = streamer->smpt->output(rsp);
310310
rsp = NULL;
311311
if (rc != 0) {
312312
break;

subsys/mgmt/mcumgr/smp.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ void *smp_alloc_rsp(const void *req, void *arg)
5858
return NULL;
5959
}
6060

61-
if (smpt->zst_ud_copy) {
62-
smpt->zst_ud_copy(rsp_nb, req_nb);
61+
if (smpt->ud_copy) {
62+
smpt->ud_copy(rsp_nb, req_nb);
6363
} else {
6464
memcpy(net_buf_user_data(rsp_nb),
6565
net_buf_user_data((void *)req_nb),
@@ -77,8 +77,8 @@ void smp_free_buf(void *buf, void *arg)
7777
return;
7878
}
7979

80-
if (smpt->zst_ud_free) {
81-
smpt->zst_ud_free(net_buf_user_data((struct net_buf *)buf));
80+
if (smpt->ud_free) {
81+
smpt->ud_free(net_buf_user_data((struct net_buf *)buf));
8282
}
8383

8484
mcumgr_buf_free(buf);
@@ -116,7 +116,7 @@ smp_handle_reqs(struct k_work *work)
116116

117117
smpt = (void *)work;
118118

119-
while ((nb = net_buf_get(&smpt->zst_fifo, K_NO_WAIT)) != NULL) {
119+
while ((nb = net_buf_get(&smpt->fifo, K_NO_WAIT)) != NULL) {
120120
smp_process_packet(smpt, nb);
121121
}
122122
}
@@ -129,18 +129,18 @@ smp_transport_init(struct smp_transport *smpt,
129129
smp_transport_ud_free_fn ud_free_func)
130130
{
131131
*smpt = (struct smp_transport) {
132-
.zst_output = output_func,
133-
.zst_get_mtu = get_mtu_func,
134-
.zst_ud_copy = ud_copy_func,
135-
.zst_ud_free = ud_free_func,
132+
.output = output_func,
133+
.get_mtu = get_mtu_func,
134+
.ud_copy = ud_copy_func,
135+
.ud_free = ud_free_func,
136136
};
137137

138138
#ifdef CONFIG_MCUMGR_SMP_REASSEMBLY
139139
smp_reassembly_init(smpt);
140140
#endif
141141

142-
k_work_init(&smpt->zst_work, smp_handle_reqs);
143-
k_fifo_init(&smpt->zst_fifo);
142+
k_work_init(&smpt->work, smp_handle_reqs);
143+
k_fifo_init(&smpt->fifo);
144144
}
145145

146146
/**
@@ -155,8 +155,8 @@ smp_transport_init(struct smp_transport *smpt,
155155
WEAK void
156156
smp_rx_req(struct smp_transport *smpt, struct net_buf *nb)
157157
{
158-
net_buf_put(&smpt->zst_fifo, nb);
159-
k_work_submit_to_queue(&smp_work_queue, &smpt->zst_work);
158+
net_buf_put(&smpt->fifo, nb);
159+
k_work_submit_to_queue(&smp_work_queue, &smpt->work);
160160
}
161161

162162
static int smp_init(const struct device *dev)

0 commit comments

Comments
 (0)