Re: [herbert-cryptodev-2.6:master 80/80] crypto/scompress.c:174:38: warning: unused variable 'dst_page'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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@xxxxxxxxx/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@xxxxxxxxx/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@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202403091614.NeUw5zcv-lkp@xxxxxxxxx/
> 
> 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:

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





[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux