* can-next: fix clang warnings
@ 2021-05-04 20:05 Marc Kleine-Budde
2021-05-04 20:05 ` [can-nextc 1/2] can: mcp251x: mcp251x_can_probe(): silence clang warning Marc Kleine-Budde
2021-05-04 20:05 ` [can-next 2/2] can: hi311x: hi3110_can_probe(): " Marc Kleine-Budde
0 siblings, 2 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2021-05-04 20:05 UTC (permalink / raw)
To: linux-can; +Cc: kernel
Hello,
This series fixes two warnings found by clang, the first one was
reported by intel's kernel test robot.
Marc
^ permalink raw reply [flat|nested] 5+ messages in thread
* [can-nextc 1/2] can: mcp251x: mcp251x_can_probe(): silence clang warning
2021-05-04 20:05 can-next: fix clang warnings Marc Kleine-Budde
@ 2021-05-04 20:05 ` Marc Kleine-Budde
2021-05-05 10:13 ` Andy Shevchenko
2021-05-04 20:05 ` [can-next 2/2] can: hi311x: hi3110_can_probe(): " Marc Kleine-Budde
1 sibling, 1 reply; 5+ messages in thread
From: Marc Kleine-Budde @ 2021-05-04 20:05 UTC (permalink / raw)
To: linux-can; +Cc: kernel, Marc Kleine-Budde, kernel test robot, Andy Shevchenko
This patch silences the following clang warning:
| drivers/net/can/spi/mcp251x.c:1333:17: warning: cast to smaller integer type
| 'enum mcp251x_model' from 'const void *' [-Wvoid-pointer-to-enum-cast]
| priv->model = (enum mcp251x_model)match;
| ^~~~~~~~~~~~~~~~~~~~~~~~~
Fixes: 8de29a5c34a5 ("can: mcp251x: Make use of device property API")
Reported-by: kernel test robot <lkp@intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/spi/mcp251x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
index 492f1bcb0516..275b2ddab143 100644
--- a/drivers/net/can/spi/mcp251x.c
+++ b/drivers/net/can/spi/mcp251x.c
@@ -1343,7 +1343,7 @@ static int mcp251x_can_probe(struct spi_device *spi)
priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES |
CAN_CTRLMODE_LOOPBACK | CAN_CTRLMODE_LISTENONLY;
if (match)
- priv->model = (enum mcp251x_model)match;
+ priv->model = (enum mcp251x_model)(kernel_ulong_t)match;
else
priv->model = spi_get_device_id(spi)->driver_data;
priv->net = net;
base-commit: 9d31d2338950293ec19d9b095fbaa9030899dcb4
prerequisite-patch-id: 2d99a92f9c04a76341ba84b5f4924c2ba03bdd88
prerequisite-patch-id: 6dbb40c8b889604bf57aa2374f34290b247b7d28
prerequisite-patch-id: 24ff9c746552e4a8e100200f13bb1732990392a3
--
2.30.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [can-next 2/2] can: hi311x: hi3110_can_probe(): silence clang warning
2021-05-04 20:05 can-next: fix clang warnings Marc Kleine-Budde
2021-05-04 20:05 ` [can-nextc 1/2] can: mcp251x: mcp251x_can_probe(): silence clang warning Marc Kleine-Budde
@ 2021-05-04 20:05 ` Marc Kleine-Budde
1 sibling, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2021-05-04 20:05 UTC (permalink / raw)
To: linux-can; +Cc: kernel, Marc Kleine-Budde
This patch silences the following clang warning:
| drivers/net/can/spi/hi311x.c:874:17: warning: cast to smaller integer type
| 'enum hi3110_model' from 'const void *' [-Wvoid-pointer-to-enum-cast]
| priv->model = (enum hi3110_model)of_id->data;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes: 57e83fb9b746 ("can: hi311x: Add Holt HI-311x CAN driver")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/spi/hi311x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/spi/hi311x.c b/drivers/net/can/spi/hi311x.c
index 6f5d6d04a8b9..9ab480a1875f 100644
--- a/drivers/net/can/spi/hi311x.c
+++ b/drivers/net/can/spi/hi311x.c
@@ -871,7 +871,7 @@ static int hi3110_can_probe(struct spi_device *spi)
CAN_CTRLMODE_BERR_REPORTING;
if (of_id)
- priv->model = (enum hi3110_model)of_id->data;
+ priv->model = (enum hi3110_model)(kernel_ulong_t)of_id->data;
else
priv->model = spi_get_device_id(spi)->driver_data;
priv->net = net;
--
2.30.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [can-nextc 1/2] can: mcp251x: mcp251x_can_probe(): silence clang warning
2021-05-04 20:05 ` [can-nextc 1/2] can: mcp251x: mcp251x_can_probe(): silence clang warning Marc Kleine-Budde
@ 2021-05-05 10:13 ` Andy Shevchenko
2021-05-05 10:45 ` Marc Kleine-Budde
0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2021-05-05 10:13 UTC (permalink / raw)
To: Marc Kleine-Budde; +Cc: linux-can, kernel, kernel test robot
On Tue, May 04, 2021 at 10:05:19PM +0200, Marc Kleine-Budde wrote:
> This patch silences the following clang warning:
>
> | drivers/net/can/spi/mcp251x.c:1333:17: warning: cast to smaller integer type
> | 'enum mcp251x_model' from 'const void *' [-Wvoid-pointer-to-enum-cast]
> | priv->model = (enum mcp251x_model)match;
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
>
> Fixes: 8de29a5c34a5 ("can: mcp251x: Make use of device property API")
> Reported-by: kernel test robot <lkp@intel.com>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
> drivers/net/can/spi/mcp251x.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
> index 492f1bcb0516..275b2ddab143 100644
> --- a/drivers/net/can/spi/mcp251x.c
> +++ b/drivers/net/can/spi/mcp251x.c
> @@ -1343,7 +1343,7 @@ static int mcp251x_can_probe(struct spi_device *spi)
> priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES |
> CAN_CTRLMODE_LOOPBACK | CAN_CTRLMODE_LISTENONLY;
> if (match)
> - priv->model = (enum mcp251x_model)match;
> + priv->model = (enum mcp251x_model)(kernel_ulong_t)match;
Usually we use uintptr_t, but either way
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Thanks!
> else
> priv->model = spi_get_device_id(spi)->driver_data;
> priv->net = net;
>
> base-commit: 9d31d2338950293ec19d9b095fbaa9030899dcb4
> prerequisite-patch-id: 2d99a92f9c04a76341ba84b5f4924c2ba03bdd88
> prerequisite-patch-id: 6dbb40c8b889604bf57aa2374f34290b247b7d28
> prerequisite-patch-id: 24ff9c746552e4a8e100200f13bb1732990392a3
> --
> 2.30.2
>
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [can-nextc 1/2] can: mcp251x: mcp251x_can_probe(): silence clang warning
2021-05-05 10:13 ` Andy Shevchenko
@ 2021-05-05 10:45 ` Marc Kleine-Budde
0 siblings, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2021-05-05 10:45 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: linux-can, kernel, kernel test robot
[-- Attachment #1: Type: text/plain, Size: 1815 bytes --]
On 05.05.2021 13:13:41, Andy Shevchenko wrote:
> On Tue, May 04, 2021 at 10:05:19PM +0200, Marc Kleine-Budde wrote:
> > This patch silences the following clang warning:
> >
> > | drivers/net/can/spi/mcp251x.c:1333:17: warning: cast to smaller integer type
> > | 'enum mcp251x_model' from 'const void *' [-Wvoid-pointer-to-enum-cast]
> > | priv->model = (enum mcp251x_model)match;
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > Fixes: 8de29a5c34a5 ("can: mcp251x: Make use of device property API")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> > ---
> > drivers/net/can/spi/mcp251x.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
> > index 492f1bcb0516..275b2ddab143 100644
> > --- a/drivers/net/can/spi/mcp251x.c
> > +++ b/drivers/net/can/spi/mcp251x.c
> > @@ -1343,7 +1343,7 @@ static int mcp251x_can_probe(struct spi_device *spi)
> > priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES |
> > CAN_CTRLMODE_LOOPBACK | CAN_CTRLMODE_LISTENONLY;
> > if (match)
> > - priv->model = (enum mcp251x_model)match;
> > + priv->model = (enum mcp251x_model)(kernel_ulong_t)match;
>
> Usually we use uintptr_t, but either way
I've updated the patch to uintptr_t.
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Thanks,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-05-05 10:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04 20:05 can-next: fix clang warnings Marc Kleine-Budde
2021-05-04 20:05 ` [can-nextc 1/2] can: mcp251x: mcp251x_can_probe(): silence clang warning Marc Kleine-Budde
2021-05-05 10:13 ` Andy Shevchenko
2021-05-05 10:45 ` Marc Kleine-Budde
2021-05-04 20:05 ` [can-next 2/2] can: hi311x: hi3110_can_probe(): " Marc Kleine-Budde
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 NNTP newsgroup(s).