public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tom Zanussi <tom.zanussi@linux.intel.com>
To: "Yu, Fenghua" <fenghua.yu@intel.com>,
	"herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"vkoul@kernel.org" <vkoul@kernel.org>
Cc: "Jiang, Dave" <dave.jiang@intel.com>,
	"Luck, Tony" <tony.luck@intel.com>,
	"Feghali, Wajdi K" <wajdi.k.feghali@intel.com>,
	"Guilford, James" <james.guilford@intel.com>,
	"Sridhar, Kanchana P" <kanchana.p.sridhar@intel.com>,
	"Gopal, Vinodh" <vinodh.gopal@intel.com>,
	"Cabiddu, Giovanni" <giovanni.cabiddu@intel.com>,
	"pavel@ucw.cz" <pavel@ucw.cz>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>
Subject: Re: [PATCH v10 14/14] dmaengine: idxd: Add support for device/wq defaults
Date: Thu, 30 Nov 2023 09:18:17 -0600	[thread overview]
Message-ID: <29ea34917cbfabf2b98b4957b7770683f5994873.camel@linux.intel.com> (raw)
In-Reply-To: <IA1PR11MB6097D7EE44240E62DEA9AC769B82A@IA1PR11MB6097.namprd11.prod.outlook.com>

Hi Fenghua,

On Thu, 2023-11-30 at 00:31 +0000, Yu, Fenghua wrote:
> Hi, Tom,
> 
> > From: Tom Zanussi <tom.zanussi@linux.intel.com>
> > > > +       /* set name to "iaa_crypto" */
> > > > +       memset(wq->name, 0, WQ_NAME_SIZE + 1);
> > > > +       strscpy(wq->name, "iaa_crypto", WQ_NAME_SIZE + 1);
> > > 
> > > Is strcpy(wq->name, "iaa_crypto") simpler than memset() and
> > > strscpy()?
> > 
> > That's what I originally had, but checkpatch complained about it,
> > suggesting
> > strscpy, so I changed it to make checkpatch happy.
> 
> Why is size WQ_NAME_SIZE+1 instead of WQ_NAME_SIZE? Will
> WQ_NAME_SIZE+1 cause mem corruption because wq->name is defined as a
> string with WQ_NAME_SIZE?

No, wq->name actually is:

        char name[WQ_NAME_SIZE + 1];

This code is doing the same thing as elsewhere in the idxd driver
except instead of sprintf() it uses strscpy().

> > 
> > > 
> > > > +
> > > > +       /* set driver_name to "crypto" */
> > > > +       memset(wq->driver_name, 0, DRIVER_NAME_SIZE + 1);
> > > > +       strscpy(wq->driver_name, "crypto", DRIVER_NAME_SIZE +
> > > > 1);
> > > 
> > > Is strcpy(wq->driver_name, "crypto") simpler?
> > 
> > Same here.
> 
> Ditto.
> 

Same.

Tom

> Thanks.
> 
> -Fenghua


      reply	other threads:[~2023-11-30 15:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 20:26 [PATCH v10 00/14] crypto: Add Intel Analytics Accelerator (IAA) crypto compression driver Tom Zanussi
2023-11-27 20:26 ` [PATCH v10 01/14] dmaengine: idxd: add external module driver support for dsa_bus_type Tom Zanussi
2023-11-27 20:26 ` [PATCH v10 02/14] dmaengine: idxd: Rename drv_enable/disable_wq to idxd_drv_enable/disable_wq, and export Tom Zanussi
2023-11-29 13:23   ` Vinod Koul
2023-11-27 20:26 ` [PATCH v10 03/14] dmaengine: idxd: Export descriptor management functions Tom Zanussi
2023-11-27 20:26 ` [PATCH v10 04/14] dmaengine: idxd: Export wq resource " Tom Zanussi
2023-11-27 20:26 ` [PATCH v10 05/14] dmaengine: idxd: Add wq private data accessors Tom Zanussi
2023-11-27 20:26 ` [PATCH v10 06/14] dmaengine: idxd: add callback support for iaa crypto Tom Zanussi
2023-11-27 20:26 ` [PATCH v10 07/14] crypto: iaa - Add IAA Compression Accelerator Documentation Tom Zanussi
2023-11-27 20:26 ` [PATCH v10 08/14] crypto: iaa - Add Intel IAA Compression Accelerator crypto driver core Tom Zanussi
2023-11-27 20:26 ` [PATCH v10 09/14] crypto: iaa - Add per-cpu workqueue table with rebalancing Tom Zanussi
2023-11-27 20:27 ` [PATCH v10 10/14] crypto: iaa - Add compression mode management along with fixed mode Tom Zanussi
2023-11-27 20:27 ` [PATCH v10 11/14] crypto: iaa - Add support for deflate-iaa compression algorithm Tom Zanussi
2023-11-27 20:27 ` [PATCH v10 12/14] crypto: iaa - Add irq support for the crypto async interface Tom Zanussi
2023-11-27 20:27 ` [PATCH v10 13/14] crypto: iaa - Add IAA Compression Accelerator stats Tom Zanussi
2023-11-27 20:27 ` [PATCH v10 14/14] dmaengine: idxd: Add support for device/wq defaults Tom Zanussi
2023-11-27 22:14   ` Dave Jiang
2023-11-27 22:42     ` Tom Zanussi
2023-11-28 20:31   ` Fenghua Yu
2023-11-28 21:09     ` Tom Zanussi
2023-11-30  0:31       ` Yu, Fenghua
2023-11-30 15:18         ` Tom Zanussi [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=29ea34917cbfabf2b98b4957b7770683f5994873.camel@linux.intel.com \
    --to=tom.zanussi@linux.intel.com \
    --cc=dave.jiang@intel.com \
    --cc=davem@davemloft.net \
    --cc=dmaengine@vger.kernel.org \
    --cc=fenghua.yu@intel.com \
    --cc=giovanni.cabiddu@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=james.guilford@intel.com \
    --cc=kanchana.p.sridhar@intel.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=tony.luck@intel.com \
    --cc=vinodh.gopal@intel.com \
    --cc=vkoul@kernel.org \
    --cc=wajdi.k.feghali@intel.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