[firefly] [PATCH] [net] fix whitespace problems in devinet.c

Daniel Baluta daniel.baluta at gmail.com
Thu Jul 11 22:50:10 EEST 2013


On Thu, Jul 11, 2013 at 9:27 AM, “Camelia <camelia.groza at gmail.com> wrote:
> Signed-off-by: Camelia Groza <camelia.groza at gmail.com>
> ---
>  net/ipv4/devinet.c |   24 ++++++++++++++----------
>  1 file changed, 14 insertions(+), 10 deletions(-)
>
> diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
> index 8d48c39..3f69ee4 100644
> --- a/net/ipv4/devinet.c
> +++ b/net/ipv4/devinet.c
> @@ -7,7 +7,7 @@
>   *             2 of the License, or (at your option) any later version.
>   *
>   *     Derived from the IP parts of dev.c 1.0.19
> - *             Authors:        Ross Biro
> + *             Authors:        Ross Biro
>   *                             Fred N. van Kempen, <waltje at uWalt.NL.Mugnet.ORG>
>   *                             Mark Evans, <evansmp at uhura.aston.ac.uk>
>   *
> @@ -90,10 +90,10 @@ static struct ipv4_devconf ipv4_devconf_dflt = {
>         IPV4_DEVCONF((*net->ipv4.devconf_dflt), attr)
>
>  static const struct nla_policy ifa_ipv4_policy[IFA_MAX+1] = {
> -       [IFA_LOCAL]             = { .type = NLA_U32 },
> -       [IFA_ADDRESS]           = { .type = NLA_U32 },
> -       [IFA_BROADCAST]         = { .type = NLA_U32 },
> -       [IFA_LABEL]             = { .type = NLA_STRING, .len = IFNAMSIZ - 1 },
> +       [IFA_LOCAL]             = { .type = NLA_U32 },
> +       [IFA_ADDRESS]           = { .type = NLA_U32 },
> +       [IFA_BROADCAST]         = { .type = NLA_U32 },
> +       [IFA_LABEL]             = { .type = NLA_STRING, .len = IFNAMSIZ - 1 },
>         [IFA_CACHEINFO]         = { .len = sizeof(struct ifa_cacheinfo) },
>  };
>
> @@ -916,7 +916,7 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg)
>         case SIOCSIFADDR:       /* Set interface address (and family) */
>         case SIOCSIFBRDADDR:    /* Set the broadcast address */
>         case SIOCSIFDSTADDR:    /* Set the destination address */
> -       case SIOCSIFNETMASK:    /* Set the netmask for the interface */
> +       case SIOCSIFNETMASK:    /* Set the netmask for the interface */
>                 ret = -EPERM;
>                 if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
>                         goto out;
> @@ -1064,7 +1064,7 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg)
>                 inet_insert_ifa(ifa);
>                 break;
>
> -       case SIOCSIFNETMASK:    /* Set the netmask for the interface */
> +       case SIOCSIFNETMASK:    /* Set the netmask for the interface */
>
>                 /*
>                  *      The mask we set must be legal.
> @@ -1303,7 +1303,8 @@ static void inetdev_changename(struct net_device *dev, struct in_device *in_dev)
>                 if (strlen(dot) + strlen(dev->name) < IFNAMSIZ)
>                         strcat(ifa->ifa_label, dot);
>                 else
> -                       strcpy(ifa->ifa_label + (IFNAMSIZ - strlen(dot) - 1), dot);
> +                       strcpy(ifa->ifa_label + (IFNAMSIZ - strlen(dot) - 1),
> +                              dot);

It is acceptable here to break the 80 chars rule.

>  skip:
>                 rtmsg_ifa(RTM_NEWADDR, ifa, NULL, 0);
>         }
> @@ -1999,7 +2000,8 @@ static int devinet_sysctl_forward(struct ctl_table *ctl, int write,
>
>                 if (valp != &IPV4_DEVCONF_DFLT(net, FORWARDING)) {
>                         if (!rtnl_trylock()) {
> -                               /* Restore the original values before restarting */
> +                               /* Restore the original values before
> +                                * restarting */
Ditto.
>                                 *valp = val;
>                                 *ppos = pos;
>                                 return restart_syscall();
> @@ -2009,7 +2011,9 @@ static int devinet_sysctl_forward(struct ctl_table *ctl, int write,
>                         } else {
>                                 struct ipv4_devconf *cnf = ctl->extra1;
>                                 struct in_device *idev =
> -                                       container_of(cnf, struct in_device, cnf);
> +                                       container_of(cnf,
> +                                                    struct in_device,
> +                                                    cnf);
Ditto. This doesn't look very good.
>                                 if (*valp)
>                                         dev_disable_lro(idev->dev);
>                                 inet_netconf_notify_devconf(net,
> --

thanks,
Daniel.


More information about the firefly mailing list