Re: [PATCH] staging: rtl8723bs: split chained assignment in xmit_linux.c
From: Andy Shevchenko
Date: Thu Feb 26 2026 - 03:00:12 EST
On Thu, Feb 26, 2026 at 10:20:26AM +0300, Dan Carpenter wrote:
> On Wed, Feb 25, 2026 at 07:10:19PM -0500, Keith Teeple wrote:
...
> > void _rtw_open_pktfile(struct sk_buff *pktptr, struct pkt_file *pfile)
> > {
> > pfile->pkt = pktptr;
> > - pfile->cur_addr = pfile->buf_start = pktptr->data;
> > - pfile->pkt_len = pfile->buf_len = pktptr->len;
> > -
> > + pfile->buf_start = pktptr->data;
> > + pfile->cur_addr = pfile->buf_start;
>
> Please don't do it like this. Do it like this:
+1, good advice!
> pfile->buf_start = pktptr->data;
> pfile->cur_addr = pktptr->data;
>
> Otherwise we have made the new version harder to read than the original
> code.
Not only read, but prone to subtle mistakes in the future!
> > + pfile->buf_len = pktptr->len;
> > + pfile->pkt_len = pfile->buf_len;
> > pfile->cur_buffer = pfile->buf_start;
> > }
--
With Best Regards,
Andy Shevchenko