diff mbox series

pci: fix kernel-doc build warning

Message ID 85dcffe7-1e6b-5735-2552-d35d127e392b@infradead.org
State Accepted
Headers show
Series pci: fix kernel-doc build warning | expand

Commit Message

Randy Dunlap Oct. 30, 2017, 12:07 a.m. UTC
From: Randy Dunlap <rdunlap@infradead.org>

Fix build error in kernel-doc notation:

../drivers/pci/pci.c:3479: ERROR: Unexpected indentation.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc:	Bjorn Helgaas <bhelgaas@google.com>
Cc:	linux-pci@vger.kernel.org
---
 drivers/pci/pci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bjorn Helgaas Nov. 7, 2017, 12:33 a.m. UTC | #1
On Sun, Oct 29, 2017 at 05:07:11PM -0700, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Fix build error in kernel-doc notation:
> 
> ../drivers/pci/pci.c:3479: ERROR: Unexpected indentation.
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc:	Bjorn Helgaas <bhelgaas@google.com>
> Cc:	linux-pci@vger.kernel.org
> ---
>  drivers/pci/pci.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- lnx-414-rc7.orig/drivers/pci/pci.c
> +++ lnx-414-rc7/drivers/pci/pci.c
> @@ -3471,7 +3471,7 @@ EXPORT_SYMBOL(devm_pci_remap_cfgspace);
>   * All operations are managed and will be undone on driver detach.
>   *
>   * Returns a pointer to the remapped memory or an ERR_PTR() encoded error code
> - * on failure. Usage example:
> + * on failure. Usage example::

I don't understand what's going on here.  Apparently there's something
special about two colons?  I saw plenty of double colons in
Documentation/, but I couldn't quickly find out what it means.

If kernel-doc thinks "example:" is a mistake, maybe we could recast
the sentence as "Example usage:"?  Putting a double colon here makes
the text look like a mistake to this human reader.

>   *
>   *	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>   *	base = devm_pci_remap_cfg_resource(&pdev->dev, res);
> 
>
Randy Dunlap Nov. 7, 2017, 12:50 a.m. UTC | #2
On 11/06/2017 04:33 PM, Bjorn Helgaas wrote:
> On Sun, Oct 29, 2017 at 05:07:11PM -0700, Randy Dunlap wrote:
>> From: Randy Dunlap <rdunlap@infradead.org>
>>
>> Fix build error in kernel-doc notation:
>>
>> ../drivers/pci/pci.c:3479: ERROR: Unexpected indentation.
>>
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc:	Bjorn Helgaas <bhelgaas@google.com>
>> Cc:	linux-pci@vger.kernel.org
>> ---
>>  drivers/pci/pci.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> --- lnx-414-rc7.orig/drivers/pci/pci.c
>> +++ lnx-414-rc7/drivers/pci/pci.c
>> @@ -3471,7 +3471,7 @@ EXPORT_SYMBOL(devm_pci_remap_cfgspace);
>>   * All operations are managed and will be undone on driver detach.
>>   *
>>   * Returns a pointer to the remapped memory or an ERR_PTR() encoded error code
>> - * on failure. Usage example:
>> + * on failure. Usage example::
> 
> I don't understand what's going on here.  Apparently there's something
> special about two colons?  I saw plenty of double colons in
> Documentation/, but I couldn't quickly find out what it means.

Sorry about my terseness.  The ending colon is not the problem.

The problem is in indentation in the example code, and changing to use
"::" tells the kernel-doc "reStructuredText" processor that the following
block is a literal block of some blob that should be kept as is.

> If kernel-doc thinks "example:" is a mistake, maybe we could recast
> the sentence as "Example usage:"?  Putting a double colon here makes
> the text look like a mistake to this human reader.
> 
>>   *
>>   *	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>   *	base = devm_pci_remap_cfg_resource(&pdev->dev, res);
>>

Like you said, there will be lots of these "::" in source files.
There is one slight alternate, if it looks any better to you, to put the
"::" on a line by itself, like so:

 * Returns a pointer to the remapped memory or an ERR_PTR() encoded error code
 * on failure. Usage example:
 *::
 *
 *	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 *	base = devm_pci_remap_cfg_resource(&pdev->dev, res);
 *	if (IS_ERR(base))
 *		return PTR_ERR(base);
 */


I can resend the patch like that if you prefer it.

thanks,
Bjorn Helgaas Nov. 8, 2017, 11:27 p.m. UTC | #3
On Sun, Oct 29, 2017 at 05:07:11PM -0700, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Fix build error in kernel-doc notation:
> 
> ../drivers/pci/pci.c:3479: ERROR: Unexpected indentation.
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>

Applied to pci/misc for v4.15, thanks!

> Cc:	Bjorn Helgaas <bhelgaas@google.com>
> Cc:	linux-pci@vger.kernel.org
> ---
>  drivers/pci/pci.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- lnx-414-rc7.orig/drivers/pci/pci.c
> +++ lnx-414-rc7/drivers/pci/pci.c
> @@ -3471,7 +3471,7 @@ EXPORT_SYMBOL(devm_pci_remap_cfgspace);
>   * All operations are managed and will be undone on driver detach.
>   *
>   * Returns a pointer to the remapped memory or an ERR_PTR() encoded error code
> - * on failure. Usage example:
> + * on failure. Usage example::
>   *
>   *	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>   *	base = devm_pci_remap_cfg_resource(&pdev->dev, res);
> 
>
diff mbox series

Patch

--- lnx-414-rc7.orig/drivers/pci/pci.c
+++ lnx-414-rc7/drivers/pci/pci.c
@@ -3471,7 +3471,7 @@  EXPORT_SYMBOL(devm_pci_remap_cfgspace);
  * All operations are managed and will be undone on driver detach.
  *
  * Returns a pointer to the remapped memory or an ERR_PTR() encoded error code
- * on failure. Usage example:
+ * on failure. Usage example::
  *
  *	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  *	base = devm_pci_remap_cfg_resource(&pdev->dev, res);