All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabien DESSENNE <fabien.dessenne@st.com>
To: Martin Kaiser <martin@kaiser.cx>,
	Jassi Brar <jassisinghbrar@gmail.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre TORGUE <alexandre.torgue@st.com>
Cc: "linux-stm32@st-md-mailman.stormreply.com" 
	<linux-stm32@st-md-mailman.stormreply.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v2 3/3] mailbox: stm32-ipcc: cast void pointers to unsigned long
Date: Mon, 2 Nov 2020 13:11:40 +0000	[thread overview]
Message-ID: <948c95e9-dcaa-fde7-05ca-e8587180f57e@st.com> (raw)
In-Reply-To: <20201101154231.14250-3-martin@kaiser.cx>

Hi Martin


Thank you for the patch.


Fabien


On 01/11/2020 4:42 pm, Martin Kaiser wrote:
> Now that the driver can be enabled by COMPILE_TEST, we see warnings on
> 64bit platforms when void pointers are cast to unsigned int (and
> vice versa).
>
> warning: cast to smaller integer type 'unsigned int' from 'void *'
>             unsigned int chan = (unsigned int)link->con_priv;
> ...
> warning: cast to 'void *' from smaller integer type 'unsigned int'
>             ipcc->controller.chans[i].con_priv = (void *)i;
>
> Update these casts to use unsigned long variables, which are the same
> size as pointers on all platforms.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>


Reviewed-by: Fabien Dessenne<fabien.dessenne@st.com>


> ---
> changes in v2
> - added this patch to fix COMPILE_TEST warnings
>
>   drivers/mailbox/stm32-ipcc.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mailbox/stm32-ipcc.c b/drivers/mailbox/stm32-ipcc.c
> index ab8fe56af948..b84e0587937c 100644
> --- a/drivers/mailbox/stm32-ipcc.c
> +++ b/drivers/mailbox/stm32-ipcc.c
> @@ -144,11 +144,11 @@ static irqreturn_t stm32_ipcc_tx_irq(int irq, void *data)
>   
>   static int stm32_ipcc_send_data(struct mbox_chan *link, void *data)
>   {
> -	unsigned int chan = (unsigned int)link->con_priv;
> +	unsigned long chan = (unsigned long)link->con_priv;
>   	struct stm32_ipcc *ipcc = container_of(link->mbox, struct stm32_ipcc,
>   					       controller);
>   
> -	dev_dbg(ipcc->controller.dev, "%s: chan:%d\n", __func__, chan);
> +	dev_dbg(ipcc->controller.dev, "%s: chan:%lu\n", __func__, chan);
>   
>   	/* set channel n occupied */
>   	stm32_ipcc_set_bits(&ipcc->lock, ipcc->reg_proc + IPCC_XSCR,
> @@ -163,7 +163,7 @@ static int stm32_ipcc_send_data(struct mbox_chan *link, void *data)
>   
>   static int stm32_ipcc_startup(struct mbox_chan *link)
>   {
> -	unsigned int chan = (unsigned int)link->con_priv;
> +	unsigned long chan = (unsigned long)link->con_priv;
>   	struct stm32_ipcc *ipcc = container_of(link->mbox, struct stm32_ipcc,
>   					       controller);
>   	int ret;
> @@ -183,7 +183,7 @@ static int stm32_ipcc_startup(struct mbox_chan *link)
>   
>   static void stm32_ipcc_shutdown(struct mbox_chan *link)
>   {
> -	unsigned int chan = (unsigned int)link->con_priv;
> +	unsigned long chan = (unsigned long)link->con_priv;
>   	struct stm32_ipcc *ipcc = container_of(link->mbox, struct stm32_ipcc,
>   					       controller);
>   
> @@ -206,7 +206,7 @@ static int stm32_ipcc_probe(struct platform_device *pdev)
>   	struct device_node *np = dev->of_node;
>   	struct stm32_ipcc *ipcc;
>   	struct resource *res;
> -	unsigned int i;
> +	unsigned long i;
>   	int ret;
>   	u32 ip_ver;
>   	static const char * const irq_name[] = {"rx", "tx"};
> @@ -265,7 +265,7 @@ static int stm32_ipcc_probe(struct platform_device *pdev)
>   						irq_thread[i], IRQF_ONESHOT,
>   						dev_name(dev), ipcc);
>   		if (ret) {
> -			dev_err(dev, "failed to request irq %d (%d)\n", i, ret);
> +			dev_err(dev, "failed to request irq %lu (%d)\n", i, ret);
>   			goto err_clk;
>   		}
>   	}

  reply	other threads:[~2020-11-02 13:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-24 13:31 [PATCH 1/2] mailbox: stm32-ipcc: add COMPILE_TEST dependency Martin Kaiser
2020-10-24 13:31 ` [PATCH 2/2] mailbox: stm32-ipcc: remove duplicate error message Martin Kaiser
2020-10-26  8:12   ` Fabien DESSENNE
2020-10-30 16:07 ` [PATCH 1/2] mailbox: stm32-ipcc: add COMPILE_TEST dependency kernel test robot
2020-10-30 16:07   ` kernel test robot
2020-11-01 15:42 ` [PATCH v2 1/3] " Martin Kaiser
2020-11-01 15:42   ` [PATCH v2 2/3] mailbox: stm32-ipcc: remove duplicate error message Martin Kaiser
2020-11-01 15:42   ` [PATCH v2 3/3] mailbox: stm32-ipcc: cast void pointers to unsigned long Martin Kaiser
2020-11-02 13:11     ` Fabien DESSENNE [this message]
2020-11-29 18:52 ` [PATCH RESEND v2 1/3] mailbox: stm32-ipcc: add COMPILE_TEST dependency Martin Kaiser
2020-11-29 18:52   ` [PATCH RESEND v2 2/3] mailbox: stm32-ipcc: remove duplicate error message Martin Kaiser
2020-11-29 18:52   ` [PATCH RESEND v2 3/3] mailbox: stm32-ipcc: cast void pointers to unsigned long Martin Kaiser

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=948c95e9-dcaa-fde7-05ca-e8587180f57e@st.com \
    --to=fabien.dessenne@st.com \
    --cc=alexandre.torgue@st.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=lkp@intel.com \
    --cc=martin@kaiser.cx \
    --cc=mcoquelin.stm32@gmail.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 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.