All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Timur Tabi <timur@codeaurora.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch net-next] net: qcom/emac: fix a sizeof() typo
Date: Mon, 13 Feb 2017 11:55:03 +0000	[thread overview]
Message-ID: <58A19E97.6000704@bfs.de> (raw)
In-Reply-To: <20170213110021.GA17205@mwanda>



Am 13.02.2017 12:00, schrieb Dan Carpenter:
> We had intended to say "sizeof(u32)" but the "u" is missing.
> Fortunately, sizeof(32) is also 4, so the original code still works.
> 
> Fixes: c4e7beea2192 ("net: qcom/emac: add ethtool support for reading hardware registers")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c b/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c
> index 0d9945fb79be..bbe24639aa5a 100644
> --- a/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c
> +++ b/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c
> @@ -227,7 +227,7 @@ static void emac_get_regs(struct net_device *netdev,
>  
>  static int emac_get_regs_len(struct net_device *netdev)
>  {
> -	return EMAC_MAX_REG_SIZE * sizeof(32);
> +	return EMAC_MAX_REG_SIZE * sizeof(u32);
>  }
>  


We have a function where the argument is ignored and the rest is const ?

emac_ethtool_get_regs_len seems the only user. So it would be fairly easy to
move that into that function.

@maintainer:
Is there a deeper logic behind this ?


re,
 wh



>  static const struct ethtool_ops emac_ethtool_ops = {
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

WARNING: multiple messages have this Message-ID (diff)
From: walter harms <wharms@bfs.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Timur Tabi <timur@codeaurora.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch net-next] net: qcom/emac: fix a sizeof() typo
Date: Mon, 13 Feb 2017 12:55:03 +0100	[thread overview]
Message-ID: <58A19E97.6000704@bfs.de> (raw)
In-Reply-To: <20170213110021.GA17205@mwanda>



Am 13.02.2017 12:00, schrieb Dan Carpenter:
> We had intended to say "sizeof(u32)" but the "u" is missing.
> Fortunately, sizeof(32) is also 4, so the original code still works.
> 
> Fixes: c4e7beea2192 ("net: qcom/emac: add ethtool support for reading hardware registers")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c b/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c
> index 0d9945fb79be..bbe24639aa5a 100644
> --- a/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c
> +++ b/drivers/net/ethernet/qualcomm/emac/emac-ethtool.c
> @@ -227,7 +227,7 @@ static void emac_get_regs(struct net_device *netdev,
>  
>  static int emac_get_regs_len(struct net_device *netdev)
>  {
> -	return EMAC_MAX_REG_SIZE * sizeof(32);
> +	return EMAC_MAX_REG_SIZE * sizeof(u32);
>  }
>  


We have a function where the argument is ignored and the rest is const ?

emac_ethtool_get_regs_len seems the only user. So it would be fairly easy to
move that into that function.

@maintainer:
Is there a deeper logic behind this ?


re,
 wh



>  static const struct ethtool_ops emac_ethtool_ops = {
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13 11:00 [patch net-next] net: qcom/emac: fix a sizeof() typo Dan Carpenter
2017-02-13 11:00 ` Dan Carpenter
2017-02-13 11:55 ` walter harms [this message]
2017-02-13 11:55   ` walter harms
2017-02-13 13:03   ` Timur Tabi
2017-02-13 13:03     ` Timur Tabi
2017-02-13 13:28     ` walter harms
2017-02-13 13:28       ` walter harms
2017-02-13 15:43       ` Timur Tabi
2017-02-13 15:43         ` Timur Tabi
2017-02-13 14:00   ` Dan Carpenter
2017-02-13 14:00     ` Dan Carpenter
2017-02-13 15:43 ` Timur Tabi
2017-02-13 15:43   ` Timur Tabi
2017-02-13 15:57 ` walter harms
2017-02-13 16:23 ` Timur Tabi
2017-02-14  3:21 ` David Miller
2017-02-14  3:21   ` David Miller

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=58A19E97.6000704@bfs.de \
    --to=wharms@bfs.de \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=timur@codeaurora.org \
    /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.