[bootlin/training-materials updates] master: Kernel slides: add "struct" keyword in example (8fbf358c)

Michael Opdenacker michael.opdenacker at bootlin.com
Tue Apr 20 15:10:47 CEST 2021


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/8fbf358c2d958213b9b56548652cbda71daefecd

>---------------------------------------------------------------

commit 8fbf358c2d958213b9b56548652cbda71daefecd
Author: Michael Opdenacker <michael.opdenacker at bootlin.com>
Date:   Tue Apr 20 15:10:47 2021 +0200

    Kernel slides: add "struct" keyword in example
    
    Signen-off-by: Michael Opdenacker <michael.opdenacker at bootlin.com>


>---------------------------------------------------------------

8fbf358c2d958213b9b56548652cbda71daefecd
 slides/kernel-frameworks2/kernel-frameworks2.tex | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/slides/kernel-frameworks2/kernel-frameworks2.tex b/slides/kernel-frameworks2/kernel-frameworks2.tex
index 4563c4e6..6e8ac04b 100644
--- a/slides/kernel-frameworks2/kernel-frameworks2.tex
+++ b/slides/kernel-frameworks2/kernel-frameworks2.tex
@@ -410,7 +410,7 @@ static int xxxfb_probe (struct pci_dev *dev, const struct pci_device_id *ent)
     \begin{minted}{c}
 int foo_probe(struct platform_device *pdev)
 {
-        foo_t *foo = kmalloc(sizeof(struct foo_t),
+        struct foo_t *foo = kmalloc(sizeof(struct foo_t),
                                     GFP_KERNEL);
         /* Register to framework, store
          * reference to framework structure in foo */
@@ -425,7 +425,7 @@ int foo_probe(struct platform_device *pdev)
 
 void foo_remove(struct platform_device *pdev)
 {
-        foo_t *foo = platform_get_drvdata(pdev);
+        struct foo_t *foo = platform_get_drvdata(pdev);
         /* Retrieve framework structure from foo
            and unregister it */
         ...
@@ -439,7 +439,7 @@ void foo_remove(struct platform_device *pdev)
     \begin{minted}{c}
 int foo_probe(struct platform_device *pdev)
 {
-        foo_t *foo = devm_kmalloc(&pdev->dev,
+        struct foo_t *foo = devm_kmalloc(&pdev->dev,
                            sizeof(struct foo_t),
                            GFP_KERNEL);
         /* Register to framework, store
@@ -453,7 +453,7 @@ int foo_probe(struct platform_device *pdev)
 
 void foo_remove(struct platform_device *pdev)
 {
-        foo_t *foo = platform_get_drvdata(pdev);
+        struct foo_t *foo = platform_get_drvdata(pdev);
         /* Retrieve framework structure from foo
            and unregister it */
         ...




More information about the training-materials-updates mailing list