Re: [PATCH 1/3] crypto: caam: fix some compile warnings

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

 




On 2015年03月04日 02:59, Kim Phillips wrote:
On Tue, 3 Mar 2015 14:50:51 +0800
<yanjiang.jin@xxxxxxxxxxxxx> 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



--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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

  Powered by Linux