All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@seco.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org,
	"David S . Miller" <davem@davemloft.net>,
	"Aymen Sghaier" <aymen.sghaier@nxp.com>,
	linux-arm-kernel@lists.infradead.org,
	"Marek Vasut" <marex@denx.de>,
	"Horia Geantă" <horia.geanta@nxp.com>
Subject: Re: [PATCH 2/2] crypto: mxs_dcp: Use sg_mapping_iter to copy data
Date: Mon, 28 Jun 2021 13:44:01 -0400	[thread overview]
Message-ID: <76f45b3d-3f4b-7ed8-b33c-49a48dad27fa@seco.com> (raw)
In-Reply-To: <20210628032522.GA1375@gondor.apana.org.au>



On 6/27/21 11:25 PM, Herbert Xu wrote:
> On Fri, Jun 25, 2021 at 10:49:08AM -0400, Sean Anderson wrote:
>>
>> What version of sparse are you using? With sparse 0.6.2, gcc 9.3.0, and
>> with C=1 and W=2 I don't see this warning.
>
> OK I've upgraded my sparse to the latest git tree, but it still
> gives the same warning, because the two types are of different
> sizes:
>
> $ make C=1 W=1 O=build-compile drivers/crypto/
> make[1]: Entering directory '/home/herbert/src/build/kernel/test/build-compile'
>    GEN     Makefile
>    CALL    ../scripts/checksyscalls.sh
>    CALL    ../scripts/atomic/check-atomics.sh
>    CC [M]  drivers/crypto/mxs-dcp.o
> In file included from ../include/linux/kernel.h:15,
>                   from ../arch/x86/include/asm/percpu.h:27,
>                   from ../arch/x86/include/asm/current.h:6,
>                   from ../include/linux/sched.h:12,
>                   from ../include/linux/ratelimit.h:6,
>                   from ../include/linux/dev_printk.h:16,
>                   from ../include/linux/device.h:15,
>                   from ../include/linux/dma-mapping.h:7,
>                   from ../drivers/crypto/mxs-dcp.c:8:
> ../drivers/crypto/mxs-dcp.c: In function \u2018mxs_dcp_aes_block_crypt\u2019:
> ../include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast
>    (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
>                              ^~
> ../include/linux/minmax.h:32:4: note: in expansion of macro \u2018__typecheck\u2019
>     (__typecheck(x, y) && __no_side_effects(x, y))
>      ^~~~~~~~~~~
> ../include/linux/minmax.h:42:24: note: in expansion of macro \u2018__safe_cmp\u2019
>    __builtin_choose_expr(__safe_cmp(x, y), \
>                          ^~~~~~~~~~
> ../include/linux/minmax.h:51:19: note: in expansion of macro \u2018__careful_cmp\u2019
>   #define min(x, y) __careful_cmp(x, y, <)
>                     ^~~~~~~~~~~~~
> ../drivers/crypto/mxs-dcp.c:369:12: note: in expansion of macro \u2018min\u2019
>        rem = min(dst_iter.length, actx->fill);
>              ^~~
>    CHECK   ../drivers/crypto/mxs-dcp.c
> ../drivers/crypto/mxs-dcp.c:369:47: error: incompatible types in comparison expression (different type sizes):
> ../drivers/crypto/mxs-dcp.c:369:47:    unsigned long *
> ../drivers/crypto/mxs-dcp.c:369:47:    unsigned int *
> make[1]: Leaving directory '/home/herbert/src/build/kernel/test/build-compile'
> $
>
> In fact as you can see that gcc is warning too.  Perhaps you're
> building on 32-bit?

Ah, that would be it. Although this module depends on ARCH_MXS ||
ARCH_MXC and does not (yet) have COMPILE_TEST as an option, so I wonder
how you ran into this :)

Either way, I will send a v2 with this fixed.

>
> Thanks,
>

WARNING: multiple messages have this Message-ID (diff)
From: Sean Anderson <sean.anderson@seco.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org,
	"David S . Miller" <davem@davemloft.net>,
	"Aymen Sghaier" <aymen.sghaier@nxp.com>,
	linux-arm-kernel@lists.infradead.org,
	"Marek Vasut" <marex@denx.de>,
	"Horia Geantă" <horia.geanta@nxp.com>
Subject: Re: [PATCH 2/2] crypto: mxs_dcp: Use sg_mapping_iter to copy data
Date: Mon, 28 Jun 2021 13:44:01 -0400	[thread overview]
Message-ID: <76f45b3d-3f4b-7ed8-b33c-49a48dad27fa@seco.com> (raw)
In-Reply-To: <20210628032522.GA1375@gondor.apana.org.au>



On 6/27/21 11:25 PM, Herbert Xu wrote:
> On Fri, Jun 25, 2021 at 10:49:08AM -0400, Sean Anderson wrote:
>>
>> What version of sparse are you using? With sparse 0.6.2, gcc 9.3.0, and
>> with C=1 and W=2 I don't see this warning.
>
> OK I've upgraded my sparse to the latest git tree, but it still
> gives the same warning, because the two types are of different
> sizes:
>
> $ make C=1 W=1 O=build-compile drivers/crypto/
> make[1]: Entering directory '/home/herbert/src/build/kernel/test/build-compile'
>    GEN     Makefile
>    CALL    ../scripts/checksyscalls.sh
>    CALL    ../scripts/atomic/check-atomics.sh
>    CC [M]  drivers/crypto/mxs-dcp.o
> In file included from ../include/linux/kernel.h:15,
>                   from ../arch/x86/include/asm/percpu.h:27,
>                   from ../arch/x86/include/asm/current.h:6,
>                   from ../include/linux/sched.h:12,
>                   from ../include/linux/ratelimit.h:6,
>                   from ../include/linux/dev_printk.h:16,
>                   from ../include/linux/device.h:15,
>                   from ../include/linux/dma-mapping.h:7,
>                   from ../drivers/crypto/mxs-dcp.c:8:
> ../drivers/crypto/mxs-dcp.c: In function \u2018mxs_dcp_aes_block_crypt\u2019:
> ../include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast
>    (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
>                              ^~
> ../include/linux/minmax.h:32:4: note: in expansion of macro \u2018__typecheck\u2019
>     (__typecheck(x, y) && __no_side_effects(x, y))
>      ^~~~~~~~~~~
> ../include/linux/minmax.h:42:24: note: in expansion of macro \u2018__safe_cmp\u2019
>    __builtin_choose_expr(__safe_cmp(x, y), \
>                          ^~~~~~~~~~
> ../include/linux/minmax.h:51:19: note: in expansion of macro \u2018__careful_cmp\u2019
>   #define min(x, y) __careful_cmp(x, y, <)
>                     ^~~~~~~~~~~~~
> ../drivers/crypto/mxs-dcp.c:369:12: note: in expansion of macro \u2018min\u2019
>        rem = min(dst_iter.length, actx->fill);
>              ^~~
>    CHECK   ../drivers/crypto/mxs-dcp.c
> ../drivers/crypto/mxs-dcp.c:369:47: error: incompatible types in comparison expression (different type sizes):
> ../drivers/crypto/mxs-dcp.c:369:47:    unsigned long *
> ../drivers/crypto/mxs-dcp.c:369:47:    unsigned int *
> make[1]: Leaving directory '/home/herbert/src/build/kernel/test/build-compile'
> $
>
> In fact as you can see that gcc is warning too.  Perhaps you're
> building on 32-bit?

Ah, that would be it. Although this module depends on ARCH_MXS ||
ARCH_MXC and does not (yet) have COMPILE_TEST as an option, so I wonder
how you ran into this :)

Either way, I will send a v2 with this fixed.

>
> Thanks,
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-06-28 17:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 21:14 [PATCH 1/2] crypto: mxs-dcp: Check for DMA mapping errors Sean Anderson
2021-06-18 21:14 ` Sean Anderson
2021-06-18 21:14 ` [PATCH 2/2] crypto: mxs_dcp: Use sg_mapping_iter to copy data Sean Anderson
2021-06-18 21:14   ` Sean Anderson
2021-06-24  6:56   ` Herbert Xu
2021-06-24  6:56     ` Herbert Xu
2021-06-24 14:58     ` Sean Anderson
2021-06-24 14:58       ` Sean Anderson
2021-06-25  0:16       ` Herbert Xu
2021-06-25  0:16         ` Herbert Xu
2021-06-25 14:49         ` Sean Anderson
2021-06-25 14:49           ` Sean Anderson
2021-06-26  3:00           ` Herbert Xu
2021-06-26  3:00             ` Herbert Xu
2021-06-28  3:25           ` Herbert Xu
2021-06-28  3:25             ` Herbert Xu
2021-06-28 17:44             ` Sean Anderson [this message]
2021-06-28 17:44               ` Sean Anderson

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=76f45b3d-3f4b-7ed8-b33c-49a48dad27fa@seco.com \
    --to=sean.anderson@seco.com \
    --cc=aymen.sghaier@nxp.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=horia.geanta@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=marex@denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.