netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] doc: sfp-phylink: correct code indentation
@ 2020-03-03 13:29 Russell King
  2020-03-03 23:35 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King @ 2020-03-03 13:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: Jakub Kicinski, Jonathan Corbet, netdev, linux-doc

Using vim to edit the phylink documentation reveals some mistakes due
to the "invisible" pythonesque white space indentation that can't be
seen with other editors. Fix it.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 Documentation/networking/sfp-phylink.rst | 32 ++++++++++++------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/Documentation/networking/sfp-phylink.rst b/Documentation/networking/sfp-phylink.rst
index 8d7af28cd835..5aec7c8857d0 100644
--- a/Documentation/networking/sfp-phylink.rst
+++ b/Documentation/networking/sfp-phylink.rst
@@ -138,27 +138,27 @@ this documentation.
 
    .. code-block:: c
 
-    static int foo_ethtool_set_link_ksettings(struct net_device *dev,
-					     const struct ethtool_link_ksettings *cmd)
-    {
-	struct foo_priv *priv = netdev_priv(dev);
-
-	return phylink_ethtool_ksettings_set(priv->phylink, cmd);
-    }
-
-    static int foo_ethtool_get_link_ksettings(struct net_device *dev,
-					     struct ethtool_link_ksettings *cmd)
-    {
-	struct foo_priv *priv = netdev_priv(dev);
+	static int foo_ethtool_set_link_ksettings(struct net_device *dev,
+						  const struct ethtool_link_ksettings *cmd)
+	{
+		struct foo_priv *priv = netdev_priv(dev);
+	
+		return phylink_ethtool_ksettings_set(priv->phylink, cmd);
+	}
 
-	return phylink_ethtool_ksettings_get(priv->phylink, cmd);
-    }
+	static int foo_ethtool_get_link_ksettings(struct net_device *dev,
+						  struct ethtool_link_ksettings *cmd)
+	{
+		struct foo_priv *priv = netdev_priv(dev);
+	
+		return phylink_ethtool_ksettings_get(priv->phylink, cmd);
+	}
 
-7. Replace the call to:
+7. Replace the call to::
 
 	phy_dev = of_phy_connect(dev, node, link_func, flags, phy_interface);
 
-   and associated code with a call to:
+   and associated code with a call to::
 
 	err = phylink_of_phy_connect(priv->phylink, node, flags);
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] doc: sfp-phylink: correct code indentation
  2020-03-03 13:29 [PATCH net-next] doc: sfp-phylink: correct code indentation Russell King
@ 2020-03-03 23:35 ` David Miller
  2020-03-04  0:34   ` Russell King - ARM Linux admin
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2020-03-03 23:35 UTC (permalink / raw)
  To: rmk+kernel; +Cc: kuba, corbet, netdev, linux-doc

From: Russell King <rmk+kernel@armlinux.org.uk>
Date: Tue, 03 Mar 2020 13:29:42 +0000

> Using vim to edit the phylink documentation reveals some mistakes due
> to the "invisible" pythonesque white space indentation that can't be
> seen with other editors. Fix it.
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

I applied this, but you do know that GIT is going to warn about the
trailing whitespace to me:

.git/rebase-apply/patch:29: trailing whitespace.
	
.git/rebase-apply/patch:39: trailing whitespace.
	
warning: 2 lines add whitespace errors.

Do the empty lines really need that leading TAB?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] doc: sfp-phylink: correct code indentation
  2020-03-03 23:35 ` David Miller
@ 2020-03-04  0:34   ` Russell King - ARM Linux admin
  0 siblings, 0 replies; 3+ messages in thread
From: Russell King - ARM Linux admin @ 2020-03-04  0:34 UTC (permalink / raw)
  To: David Miller; +Cc: kuba, corbet, netdev, linux-doc

On Tue, Mar 03, 2020 at 03:35:46PM -0800, David Miller wrote:
> From: Russell King <rmk+kernel@armlinux.org.uk>
> Date: Tue, 03 Mar 2020 13:29:42 +0000
> 
> > Using vim to edit the phylink documentation reveals some mistakes due
> > to the "invisible" pythonesque white space indentation that can't be
> > seen with other editors. Fix it.
> > 
> > Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> 
> I applied this, but you do know that GIT is going to warn about the
> trailing whitespace to me:
> 
> .git/rebase-apply/patch:29: trailing whitespace.
> 	
> .git/rebase-apply/patch:39: trailing whitespace.
> 	
> warning: 2 lines add whitespace errors.
> 
> Do the empty lines really need that leading TAB?

If vim's syntax colouring is correct, then it does need the tab for
the code sequence to be recognised as a block of code.

As kerneldoc is based on python, and white-space indentation defining
a block of code is a very (annoying) pythonesque thing, it seems that
vim's probably correct.  But... unless someone knows how the .rst
format really works...

It could be that vim's syntax colouring for .rst files is broken.
I was hoping that the documentation people would've spoken up about
that though, as I explicitly stated in the commit message that the
patch was based on vim's behaviour.

Not having the tabs causes vim to reverse-bold a lot of the file,
making it basically uneditable without sunglasses.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-04  0:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-03 13:29 [PATCH net-next] doc: sfp-phylink: correct code indentation Russell King
2020-03-03 23:35 ` David Miller
2020-03-04  0:34   ` Russell King - ARM Linux admin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).