oe-kbuild-all.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Barry Song <v-songbaohua@oppo.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-crypto@vger.kernel.org,
	Herbert Xu <herbert@gondor.apana.org.au>
Subject: [herbert-cryptodev-2.6:master 80/80] crypto/scompress.c:174:38: warning: unused variable 'dst_page'
Date: Sat, 9 Mar 2024 16:42:07 +0800	[thread overview]
Message-ID: <202403091614.NeUw5zcv-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
head:   77292bb8ca69c808741aadbd29207605296e24af
commit: 77292bb8ca69c808741aadbd29207605296e24af [80/80] crypto: scomp - remove memcpy if sg_nents is 1 and pages are lowmem
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20240309/202403091614.NeUw5zcv-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240309/202403091614.NeUw5zcv-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403091614.NeUw5zcv-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from crypto/scompress.c:12:
   include/crypto/scatterwalk.h: In function 'scatterwalk_pagedone':
   include/crypto/scatterwalk.h:76:30: warning: variable 'page' set but not used [-Wunused-but-set-variable]
      76 |                 struct page *page;
         |                              ^~~~
   crypto/scompress.c: In function 'scomp_acomp_comp_decomp':
>> crypto/scompress.c:174:38: warning: unused variable 'dst_page' [-Wunused-variable]
     174 |                         struct page *dst_page = sg_page(req->dst);
         |                                      ^~~~~~~~


vim +/dst_page +174 crypto/scompress.c

   112	
   113	static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir)
   114	{
   115		struct crypto_acomp *tfm = crypto_acomp_reqtfm(req);
   116		void **tfm_ctx = acomp_tfm_ctx(tfm);
   117		struct crypto_scomp *scomp = *tfm_ctx;
   118		void **ctx = acomp_request_ctx(req);
   119		struct scomp_scratch *scratch;
   120		void *src, *dst;
   121		unsigned int dlen;
   122		int ret;
   123	
   124		if (!req->src || !req->slen || req->slen > SCOMP_SCRATCH_SIZE)
   125			return -EINVAL;
   126	
   127		if (req->dst && !req->dlen)
   128			return -EINVAL;
   129	
   130		if (!req->dlen || req->dlen > SCOMP_SCRATCH_SIZE)
   131			req->dlen = SCOMP_SCRATCH_SIZE;
   132	
   133		dlen = req->dlen;
   134	
   135		scratch = raw_cpu_ptr(&scomp_scratch);
   136		spin_lock(&scratch->lock);
   137	
   138		if (sg_nents(req->src) == 1 && !PageHighMem(sg_page(req->src))) {
   139			src = page_to_virt(sg_page(req->src)) + req->src->offset;
   140		} else {
   141			scatterwalk_map_and_copy(scratch->src, req->src, 0,
   142						 req->slen, 0);
   143			src = scratch->src;
   144		}
   145	
   146		if (req->dst && sg_nents(req->dst) == 1 && !PageHighMem(sg_page(req->dst)))
   147			dst = page_to_virt(sg_page(req->dst)) + req->dst->offset;
   148		else
   149			dst = scratch->dst;
   150	
   151		if (dir)
   152			ret = crypto_scomp_compress(scomp, src, req->slen,
   153						    dst, &req->dlen, *ctx);
   154		else
   155			ret = crypto_scomp_decompress(scomp, src, req->slen,
   156						      dst, &req->dlen, *ctx);
   157		if (!ret) {
   158			if (!req->dst) {
   159				req->dst = sgl_alloc(req->dlen, GFP_ATOMIC, NULL);
   160				if (!req->dst) {
   161					ret = -ENOMEM;
   162					goto out;
   163				}
   164			} else if (req->dlen > dlen) {
   165				ret = -ENOSPC;
   166				goto out;
   167			}
   168			if (dst == scratch->dst) {
   169				scatterwalk_map_and_copy(scratch->dst, req->dst, 0,
   170							 req->dlen, 1);
   171			} else {
   172				int nr_pages = DIV_ROUND_UP(req->dst->offset + req->dlen, PAGE_SIZE);
   173				int i;
 > 174				struct page *dst_page = sg_page(req->dst);
   175	
   176				for (i = 0; i < nr_pages; i++)
   177					flush_dcache_page(dst_page + i);
   178			}
   179		}
   180	out:
   181		spin_unlock(&scratch->lock);
   182		return ret;
   183	}
   184	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2024-03-09  8:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-09  8:42 kernel test robot [this message]
2024-03-09  9:10 ` [herbert-cryptodev-2.6:master 80/80] crypto/scompress.c:174:38: warning: unused variable 'dst_page' Barry Song
2024-03-10 14:04   ` Huacai Chen

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=202403091614.NeUw5zcv-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=v-songbaohua@oppo.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).