linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-can@vger.kernel.org, kernel@pengutronix.de,
	kernel test robot <lkp@intel.com>
Subject: Re: [can-nextc 1/2] can: mcp251x: mcp251x_can_probe(): silence clang warning
Date: Wed, 5 May 2021 12:45:36 +0200	[thread overview]
Message-ID: <20210505104536.d6fli5gaqu4tssox@pengutronix.de> (raw)
In-Reply-To: <YJJv1f95WfTeJXCZ@smile.fi.intel.com>

[-- 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 --]

  reply	other threads:[~2021-05-05 10:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-05-04 20:05 ` [can-next 2/2] can: hi311x: hi3110_can_probe(): " Marc Kleine-Budde

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=20210505104536.d6fli5gaqu4tssox@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=lkp@intel.com \
    /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 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).