diff mbox

mmc: mmci_qcom_dml: fix is never less than zero warning.

Message ID 1410251689-12740-1-git-send-email-srinivas.kandagatla@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Srinivas Kandagatla Sept. 9, 2014, 8:34 a.m. UTC
This patch fixes a typo which resulted in 'is never less
than zero warning' reported by static checker.

	drivers/mmc/host/mmci_qcom_dml.c:131 dml_hw_init()
	warn: unsigned 'producer_id' is never less than zero.

drivers/mmc/host/mmci_qcom_dml.c
   121  /* Initialize the dml hardware connected to SD Card controller */
   122  int dml_hw_init(struct mmci_host *host, struct device_node *np)
   123  {
   124          u32 config;
   125          void __iomem *base;
   126          u32 consumer_id, producer_id;
   127
   128          consumer_id = of_get_dml_pipe_index(np, "tx");
   129          producer_id = of_get_dml_pipe_index(np, "rx");
   130
   131          if (producer_id < 0 || consumer_id < 0)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   132

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
Hi Ulf, 

This patch is on top of https://git.linaro.org/people/ulf.hansson/mmc.git next branch
to fix up a warning reported by static checker tool.

Are you ok to take this patch as it is or do you think I should resend the 
original DML patch with this fix?

thanks,
srini

 drivers/mmc/host/mmci_qcom_dml.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ulf Hansson Sept. 9, 2014, 11:53 a.m. UTC | #1
On 9 September 2014 10:34, Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
> This patch fixes a typo which resulted in 'is never less
> than zero warning' reported by static checker.
>
>         drivers/mmc/host/mmci_qcom_dml.c:131 dml_hw_init()
>         warn: unsigned 'producer_id' is never less than zero.
>
> drivers/mmc/host/mmci_qcom_dml.c
>    121  /* Initialize the dml hardware connected to SD Card controller */
>    122  int dml_hw_init(struct mmci_host *host, struct device_node *np)
>    123  {
>    124          u32 config;
>    125          void __iomem *base;
>    126          u32 consumer_id, producer_id;
>    127
>    128          consumer_id = of_get_dml_pipe_index(np, "tx");
>    129          producer_id = of_get_dml_pipe_index(np, "rx");
>    130
>    131          if (producer_id < 0 || consumer_id < 0)
>                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    132
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
> Hi Ulf,
>
> This patch is on top of https://git.linaro.org/people/ulf.hansson/mmc.git next branch
> to fix up a warning reported by static checker tool.
>
> Are you ok to take this patch as it is or do you think I should resend the
> original DML patch with this fix?
>

I am fine with this, I will fold it into the original patch. Applied for next.

Kind regards
Uffe

> thanks,
> srini
>
>  drivers/mmc/host/mmci_qcom_dml.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/mmci_qcom_dml.c b/drivers/mmc/host/mmci_qcom_dml.c
> index 300ef50..2b7fc37 100644
> --- a/drivers/mmc/host/mmci_qcom_dml.c
> +++ b/drivers/mmc/host/mmci_qcom_dml.c
> @@ -123,7 +123,7 @@ int dml_hw_init(struct mmci_host *host, struct device_node *np)
>  {
>         u32 config;
>         void __iomem *base;
> -       u32 consumer_id, producer_id;
> +       int consumer_id, producer_id;
>
>         consumer_id = of_get_dml_pipe_index(np, "tx");
>         producer_id = of_get_dml_pipe_index(np, "rx");
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/mmci_qcom_dml.c b/drivers/mmc/host/mmci_qcom_dml.c
index 300ef50..2b7fc37 100644
--- a/drivers/mmc/host/mmci_qcom_dml.c
+++ b/drivers/mmc/host/mmci_qcom_dml.c
@@ -123,7 +123,7 @@  int dml_hw_init(struct mmci_host *host, struct device_node *np)
 {
 	u32 config;
 	void __iomem *base;
-	u32 consumer_id, producer_id;
+	int consumer_id, producer_id;
 
 	consumer_id = of_get_dml_pipe_index(np, "tx");
 	producer_id = of_get_dml_pipe_index(np, "rx");