public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Keith Teeple <keithrteeple@gmail.com>,
	gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org, s9430399@naver.com
Subject: Re: [PATCH] staging: rtl8723bs: split chained assignment in xmit_linux.c
Date: Thu, 26 Feb 2026 09:59:01 +0200	[thread overview]
Message-ID: <aZ_9RflM8c_ACHjd@smile.fi.intel.com> (raw)
In-Reply-To: <aZ_0OratIkUBNHmy@stanley.mountain>

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



      reply	other threads:[~2026-02-26  7:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-26  0:10 [PATCH] staging: rtl8723bs: split chained assignment in xmit_linux.c Keith Teeple
2026-02-26  1:41 ` Greg KH
2026-02-26  7:20 ` Dan Carpenter
2026-02-26  7:59   ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aZ_9RflM8c_ACHjd@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=dan.carpenter@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=keithrteeple@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=s9430399@naver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox