diff options
author | GUO Zihua <guozihua@huawei.com> | 2022-11-17 17:11:59 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-12-14 11:28:25 +0100 |
commit | 1a34c9c1bed8adfc005d0ab874a35bf42f274b04 (patch) | |
tree | 770c021a028a365b2881f48d8a7a6356f0f6278f /net/9p | |
parent | c10f1229006d76da6c0678ebaf055ace23d85631 (diff) | |
download | linux-stable-1a34c9c1bed8adfc005d0ab874a35bf42f274b04.tar.gz linux-stable-1a34c9c1bed8adfc005d0ab874a35bf42f274b04.tar.bz2 linux-stable-1a34c9c1bed8adfc005d0ab874a35bf42f274b04.zip |
9p/fd: Use P9_HDRSZ for header size
[ Upstream commit 6854fadbeee10891ed74246bdc05031906b6c8cf ]
Cleanup hardcoded header sizes to use P9_HDRSZ instead of '7'
Link: https://lkml.kernel.org/r/20221117091159.31533-4-guozihua@huawei.com
Signed-off-by: GUO Zihua <guozihua@huawei.com>
Reviewed-by: Christian Schoenebeck <linux_oss@crudebyte.com>
[Dominique: commit message adjusted to make sense after offset size
adjustment got removed]
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/9p')
-rw-r--r-- | net/9p/trans_fd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index e03ff8df1d3f..0ef3d2ede6e6 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -133,7 +133,7 @@ struct p9_conn { struct list_head unsent_req_list; struct p9_req_t *rreq; struct p9_req_t *wreq; - char tmp_buf[7]; + char tmp_buf[P9_HDRSZ]; struct p9_fcall rc; int wpos; int wsize; @@ -306,7 +306,7 @@ static void p9_read_work(struct work_struct *work) if (!m->rc.sdata) { m->rc.sdata = m->tmp_buf; m->rc.offset = 0; - m->rc.capacity = 7; /* start by reading header */ + m->rc.capacity = P9_HDRSZ; /* start by reading header */ } clear_bit(Rpending, &m->wsched); @@ -329,7 +329,7 @@ static void p9_read_work(struct work_struct *work) p9_debug(P9_DEBUG_TRANS, "got new header\n"); /* Header size */ - m->rc.size = 7; + m->rc.size = P9_HDRSZ; err = p9_parse_header(&m->rc, &m->rc.size, NULL, NULL, 0); if (err) { p9_debug(P9_DEBUG_ERROR, |