Thread (4 messages) 4 messages, 2 authors, 2021-03-23

Re: [PATCH 1/5] cifsd: add server handler and tranport layers

From: Matthew Wilcox <willy@infradead.org>
Date: 2021-03-22 22:19:50
Also in: linux-fsdevel, lkml

On Mon, Mar 22, 2021 at 02:13:40PM +0900, Namjae Jeon wrote:
+#define RESPONSE_BUF(w)		((void *)(w)->response_buf)
+#define REQUEST_BUF(w)		((void *)(w)->request_buf)
Why do you do this obfuscation?
+#define RESPONSE_BUF_NEXT(w)	\
+	((void *)((w)->response_buf + (w)->next_smb2_rsp_hdr_off))
+#define REQUEST_BUF_NEXT(w)	\
+	((void *)((w)->request_buf + (w)->next_smb2_rcv_hdr_off))
These obfuscations aren't even used; delete them
+#define RESPONSE_SZ(w)		((w)->response_sz)
+
+#define INIT_AUX_PAYLOAD(w)	((w)->aux_payload_buf = NULL)
+#define HAS_AUX_PAYLOAD(w)	((w)->aux_payload_sz != 0)
I mean, do you really find it clearer to write:

	if (HAS_AUX_PAYLOAD(work))
than
	if (work->aux_payload_sz)

The unobfuscated version is actually shorter!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help