netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: "Nelson, Shannon" <shannon.nelson@amd.com>,
	"Pucha, HimasekharX Reddy" <himasekharx.reddy.pucha@intel.com>,
	Kunwu Chan <chentao@kylinos.cn>,
	"Brandeburg, Jesse" <jesse.brandeburg@intel.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"jeffrey.t.kirsher@intel.com" <jeffrey.t.kirsher@intel.com>
Cc: Kunwu Chan <kunwu.chan@hotmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Lobakin, Aleksander" <aleksander.lobakin@intel.com>,
	"intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>,
	Simon Horman <horms@kernel.org>
Subject: Re: [Intel-wired-lan] [PATCH v5 iwl-next] i40e: Use correct buffer size in i40e_dbg_command_read
Date: Wed, 20 Dec 2023 14:12:17 -0800	[thread overview]
Message-ID: <fbc0ae3f-ced6-39c0-2e9c-f5d56cb26d43@intel.com> (raw)
In-Reply-To: <bd95de9e-1dcc-4fbd-ba47-9d33c8bdc6fa@amd.com>



On 12/19/2023 5:32 PM, Nelson, Shannon wrote:
> On 12/17/2023 9:54 PM, Pucha, HimasekharX Reddy wrote:
>>
>>> -----Original Message-----
>>> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf 
>>> Of Kunwu Chan
>>> Subject: [Intel-wired-lan] [PATCH v5 iwl-next] i40e: Use correct 
>>> buffer size in i40e_dbg_command_read
>>>
>>> The size of "i40e_dbg_command_buf" is 256, the size of "name"
>>> depends on "IFNAMSIZ", plus a null character and format size,
>>> the total size is more than 256.
>>>
>>> Improve readability and maintainability by replacing a hardcoded string
>>> allocation and formatting by the use of the kasprintf() helper.
>>>
>>> Fixes: 02e9c290814c ("i40e: debugfs interface")
>>> Suggested-by: Simon Horman <horms@kernel.org>
>>> Suggested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
>>> Suggested-by: Tony Nguyen <anthony.l.nguyen@intel.com>
>>> Cc: Kunwu Chan <kunwu.chan@hotmail.com>
>>> Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
>>> ---

...

> Much of this debugfs command code was an early driver hack that probably 
> never should have gone upstream in the form that it did.  The 
> i40e_dbg_command_buf itself was originally meant as a scratchpad to put 
> the 'last command processed', which was not really very useful, and as a 
> static global that might be written by any number of instances of i40e 
> devices, was problematic from the beginning.  Now, unless I'm mistaken, 
> it looks like nothing is writing to the buffer at all anymore, so the 
> buffer and the i40e_dbg_command_read() callback probably should just all 
> go away rather than trying to pretty up some useless code.

Thanks for the history Shannon. I'm not seeing the buffer used either 
so, I agree, we should remove it altogether.

Thanks,
Tony

> sln

      reply	other threads:[~2023-12-20 22:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08  3:19 [PATCH v5 iwl-next] i40e: Use correct buffer size in i40e_dbg_command_read Kunwu Chan
2023-12-08 15:00 ` Alexander Lobakin
2023-12-09 19:11 ` Simon Horman
2023-12-18  5:54 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-12-20  1:32   ` Nelson, Shannon
2023-12-20 22:12     ` Tony Nguyen [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=fbc0ae3f-ced6-39c0-2e9c-f5d56cb26d43@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=chentao@kylinos.cn \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=himasekharx.reddy.pucha@intel.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=kuba@kernel.org \
    --cc=kunwu.chan@hotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shannon.nelson@amd.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;
as well as URLs for NNTP newsgroup(s).