loongarch.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Huacai Chen <chenhuacai@kernel.org>
To: Barry Song <21cnbao@gmail.com>
Cc: lkp@intel.com, kernel@xen0n.name, herbert@gondor.apana.org.au,
	 linux-crypto@vger.kernel.org, oe-kbuild-all@lists.linux.dev,
	 v-songbaohua@oppo.com, loongarch@lists.linux.dev
Subject: Re: [herbert-cryptodev-2.6:master 80/80] crypto/scompress.c:174:38: warning: unused variable 'dst_page'
Date: Sun, 10 Mar 2024 22:04:40 +0800	[thread overview]
Message-ID: <CAAhV-H4VnM=Dw8N7j9ySWNpWVxCKeUnwFTmFOQBmLtTnfopRFQ@mail.gmail.com> (raw)
In-Reply-To: <20240309091057.7954-1-21cnbao@gmail.com>

Hi, Barry,

On Sat, Mar 9, 2024 at 5:11 PM Barry Song <21cnbao@gmail.com> wrote:
>
> > 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);
> > [snipped]
> >    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);
>
> + Huacai, Xuerui
>
> loongarch code needs a fix, it should have removed the below
> two macros:
OK, seems reasonable.

Huacai

>
> diff --git a/arch/loongarch/include/asm/cacheflush.h b/arch/loongarch/include/asm/cacheflush.h
> index 80bd74106985..f8754d08a31a 100644
> --- a/arch/loongarch/include/asm/cacheflush.h
> +++ b/arch/loongarch/include/asm/cacheflush.h
> @@ -37,8 +37,6 @@ void local_flush_icache_range(unsigned long start, unsigned long end);
>  #define flush_icache_range     local_flush_icache_range
>  #define flush_icache_user_range        local_flush_icache_range
>
> -#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
> -
>  #define flush_cache_all()                              do { } while (0)
>  #define flush_cache_mm(mm)                             do { } while (0)
>  #define flush_cache_dup_mm(mm)                         do { } while (0)
> @@ -47,7 +45,6 @@ void local_flush_icache_range(unsigned long start, unsigned long end);
>  #define flush_cache_vmap(start, end)                   do { } while (0)
>  #define flush_cache_vunmap(start, end)                 do { } while (0)
>  #define flush_icache_user_page(vma, page, addr, len)   do { } while (0)
> -#define flush_dcache_page(page)                                do { } while (0)
>  #define flush_dcache_mmap_lock(mapping)                        do { } while (0)
>  #define flush_dcache_mmap_unlock(mapping)              do { } while (0)
>
>
> as include/asm-generic/cacheflush.h already has the below,
>
> #ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
> static inline void flush_dcache_page(struct page *page)
> {
> }
>
> #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
> #endif
>
> >    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
>
> Thanks
> Barry
>

      reply	other threads:[~2024-03-10 14:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <202403091614.NeUw5zcv-lkp@intel.com>
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 [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='CAAhV-H4VnM=Dw8N7j9ySWNpWVxCKeUnwFTmFOQBmLtTnfopRFQ@mail.gmail.com' \
    --to=chenhuacai@kernel.org \
    --cc=21cnbao@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kernel@xen0n.name \
    --cc=linux-crypto@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=loongarch@lists.linux.dev \
    --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 read-only IMAP folder(s) and NNTP newsgroup(s).