summaryrefslogtreecommitdiffstats
path: root/samples/configfs
Commit message (Collapse)AuthorAgeFilesLines
* treewide: remove editor modelines and cruftMasahiro Yamada2021-05-071-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | The section "19) Editor modelines and other cruft" in Documentation/process/coding-style.rst clearly says, "Do not include any of these in source files." I recently receive a patch to explicitly add a new one. Let's do treewide cleanups, otherwise some people follow the existing code and attempt to upstream their favoriate editor setups. It is even nicer if scripts/checkpatch.pl can check it. If we like to impose coding style in an editor-independent manner, I think editorconfig (patch [1]) is a saner solution. [1] https://lore.kernel.org/lkml/20200703073143.423557-1-danny@kdrag0n.dev/ Link: https://lkml.kernel.org/r/20210324054457.1477489-1-masahiroy@kernel.org Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Miguel Ojeda <ojeda@kernel.org> [auxdisplay] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* samples: configfs: prefer pr_err() over bare printk(KERN_ERRBartosz Golaszewski2020-10-071-3/+2
| | | | | | | pr_*() printing helpers are preferred over using bare printk(). Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* samples: configfs: don't use spaces before tabsBartosz Golaszewski2020-10-071-1/+1
| | | | | | | | The copyright notice alarms checkpatch.pl of usin spaces before tabs. Fix this. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* samples: configfs: consolidate local variables of the same typeBartosz Golaszewski2020-10-071-2/+1
| | | | | | | | Move local variables of the same type into a single line for better readability. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* samples: configfs: don't reinitialize variables which are already zeroedBartosz Golaszewski2020-10-071-2/+0
| | | | | | | | The structure containing the storeme field is allocated using kzalloc(). There's no need to set it to 0 again. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* samples: configfs: replace simple_strtoul() with kstrtoint()Bartosz Golaszewski2020-10-071-20/+9
| | | | | | | simple_strtoul() is deprecated. Use kstrtoint(). Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* samples: configfs: fix alignment in item structBartosz Golaszewski2020-10-071-1/+1
| | | | | | | | Aling the assignment of a static structure's field to be consistent with all other instances. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* samples: configfs: drop unnecessary ternary operatorsBartosz Golaszewski2020-10-071-5/+5
| | | | | | | | | | | Checking pointers for NULL value before passing them to container_of() is pointless because even if we return NULL from the ternary operator, none of the users checks the returned value but they instead dereference it unconditionally. AFAICT this cannot really happen either. Simplify the code by removing the ternary operators from to_childless() et al. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* samples: configfs: remove redundant newlinesBartosz Golaszewski2020-10-071-6/+0
| | | | | | | | There's no need for suplemental newlines in the source file - especially since the examples are well divided with comments already. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 145Thomas Gleixner2019-05-301-15/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 59 temple place suite 330 boston ma 021110 1307 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 84 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190524100844.756442981@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner2019-05-211-0/+1
| | | | | | | | | | | | | | Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* configfs: make config_item_type constBhumika Goyal2017-10-191-4/+4
| | | | | | | | | | | Make config_item_type structures const as they are either passed to a function having the argument as const or stored in the const "ci_type" field of a config_item structure. Done using Coccinelle. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* configfs: remove old APIChristoph Hellwig2015-10-132-0/+406
Remove the old show_attribute and store_attribute methods and update the documentation. Also replace the two C samples with a single new one in the proper samples directory where people expect to find it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>