From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757860AbbCDCdf (ORCPT ); Tue, 3 Mar 2015 21:33:35 -0500 Received: from mail.windriver.com ([147.11.1.11]:36469 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755221AbbCDCde (ORCPT ); Tue, 3 Mar 2015 21:33:34 -0500 Message-ID: <54F66EA3.7080506@windriver.com> Date: Wed, 4 Mar 2015 10:32:03 +0800 From: yjin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Kim Phillips CC: , , , , , , , , Subject: Re: [PATCH 1/3] crypto: caam: fix some compile warnings References: <1425365453-19358-1-git-send-email-yanjiang.jin@windriver.com> <1425365453-19358-2-git-send-email-yanjiang.jin@windriver.com> <20150303125953.8585904680288a9734566b42@freescale.com> In-Reply-To: <20150303125953.8585904680288a9734566b42@freescale.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015年03月04日 02:59, Kim Phillips wrote: > On Tue, 3 Mar 2015 14:50:51 +0800 > wrote: > >> This commit is to avoid the below warnings: >> >> drivers/crypto/caam/sg_sw_sec4.h:88:12: warning: >> 'dma_map_sg_chained' defined but not used [-Wunused-function] >> static int dma_map_sg_chained(struct device *dev, struct scatterlist *sg, >> ^ >> drivers/crypto/caam/sg_sw_sec4.h:104:12: warning: >> 'dma_unmap_sg_chained' defined but not used [-Wunused-function] >> static int dma_unmap_sg_chained(struct device *dev, >> ^ > I'm not seeing these warnings - both caamalg.c and caamhash.c use > those functions fine. As you said, both caamalg.c and caamhash.c use those functions, so no warning reported. But if a new file just wants to include "sg_sw_sec4.h", doesn't want to use these functions, the above warnings will appear. We can find an example in Freescale SDK 1.6: caampkc.c includes pkc_desc.h, pkc_desc.h includes sg_sw_sec4.h, but caampkc.c doesn't call those functions. Without my patch, every file which includes sg_sw_sec4.h must call these two functions in the future, I don't think it is a good idea. Thanks! Yanjiang > >> -static int dma_map_sg_chained(struct device *dev, struct scatterlist *sg, >> +static inline int dma_map_sg_chained(struct device *dev, struct scatterlist *sg, >> unsigned int nents, enum dma_data_direction dir, >> bool chained) > not to mention this isn't how to fix a defined but not used warning: > marking the functions inline results in different compiler output. > > NACK from me. > > Kim > >