Skip to content

Commit

Permalink
drm/drv: Use // for comments in example code
Browse files Browse the repository at this point in the history
This improves Sphinx output in two ways:

- It avoids an unmatched single-quote ('), about which Sphinx complained:

    Documentation/gpu/drm-internals.rst:298:
    WARNING: Could not lex literal_block as "c". Highlighting skipped.

  An alternative approach would be to replace "can't" with a word that
  doesn't have a single-quote.

- It lets Sphinx format the comments in italics and grey, making the
  code slightly easier to read.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Acked-by: Daniel Vetter <daniel@ffwll.ch> [via irc]
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190808163629.14280-1-j.neuschaefer@gmx.net
  • Loading branch information
Jonathan Neuschäfer authored and Sam Ravnborg committed Aug 19, 2019
1 parent 2989f64 commit 56d8d64
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions drivers/gpu/drm/drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,9 @@ void drm_minor_release(struct drm_minor *minor)
* struct drm_device *drm;
* int ret;
*
* [
* devm_kzalloc() can't be used here because the drm_device
* lifetime can exceed the device lifetime if driver unbind
* happens when userspace still has open file descriptors.
* ]
* // devm_kzalloc() can't be used here because the drm_device '
* // lifetime can exceed the device lifetime if driver unbind
* // happens when userspace still has open file descriptors.
* priv = kzalloc(sizeof(*priv), GFP_KERNEL);
* if (!priv)
* return -ENOMEM;
Expand All @@ -355,7 +353,7 @@ void drm_minor_release(struct drm_minor *minor)
* if (IS_ERR(priv->pclk))
* return PTR_ERR(priv->pclk);
*
* [ Further setup, display pipeline etc ]
* // Further setup, display pipeline etc
*
* platform_set_drvdata(pdev, drm);
*
Expand All @@ -370,7 +368,7 @@ void drm_minor_release(struct drm_minor *minor)
* return 0;
* }
*
* [ This function is called before the devm_ resources are released ]
* // This function is called before the devm_ resources are released
* static int driver_remove(struct platform_device *pdev)
* {
* struct drm_device *drm = platform_get_drvdata(pdev);
Expand All @@ -381,7 +379,7 @@ void drm_minor_release(struct drm_minor *minor)
* return 0;
* }
*
* [ This function is called on kernel restart and shutdown ]
* // This function is called on kernel restart and shutdown
* static void driver_shutdown(struct platform_device *pdev)
* {
* drm_atomic_helper_shutdown(platform_get_drvdata(pdev));
Expand Down

0 comments on commit 56d8d64

Please sign in to comment.