From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Bhumika Goyal <bhumirks@gmail.com>,
julia.lawall@lip6.fr, pantelis.antoniou@gmail.com,
vbordug@ru.mvista.com, f.fainelli@gmail.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] net: constify mdiobb_ops structures
Date: Mon, 16 Jan 2017 23:48:20 +0300 [thread overview]
Message-ID: <c12e3f5b-7fa6-fa61-d18b-a4069026a014@cogentembedded.com> (raw)
In-Reply-To: <1484330546-16569-1-git-send-email-bhumirks@gmail.com>
Hello!
On 01/13/2017 09:02 PM, Bhumika Goyal wrote:
> Declare mdiobb_ops structures as const as they are only stored in the
> ops field of mdiobb_ctrl structures. This field is of type const, so
> mdiobb_ops structures having this property can be declared const too.
> Done using Coccinelle:
[...]
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
[...]
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index 92d7692..1b0acd1 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -171,7 +171,7 @@ static int ravb_get_mdio_data(struct mdiobb_ctrl *ctrl)
> }
>
> /* MDIO bus control struct */
> -static struct mdiobb_ops bb_ops = {
> +static const struct mdiobb_ops bb_ops = {
> .owner = THIS_MODULE,
> .set_mdc = ravb_set_mdc,
> .set_mdio_dir = ravb_set_mdio_dir,
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 00fafab..6ef5dd8 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -1052,7 +1052,7 @@ static void sh_mdc_ctrl(struct mdiobb_ctrl *ctrl, int bit)
> }
>
> /* mdio bus control struct */
> -static struct mdiobb_ops bb_ops = {
> +static const struct mdiobb_ops bb_ops = {
> .owner = THIS_MODULE,
> .set_mdc = sh_mdc_ctrl,
> .set_mdio_dir = sh_mmd_ctrl,
[...]
For the above 2 drivers:
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
MBR, Sergei
prev parent reply other threads:[~2017-01-16 20:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-13 18:02 Bhumika Goyal
2017-01-16 18:47 ` David Miller
2017-01-16 20:48 ` Sergei Shtylyov [this message]
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=c12e3f5b-7fa6-fa61-d18b-a4069026a014@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=bhumirks@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=pantelis.antoniou@gmail.com \
--cc=vbordug@ru.mvista.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
all inboxes | Powered by JetHome®