Skip to content

samples: configfs: refactor the configfs sample code

Bartosz Golaszewski lkml 1 version NAK

Status from this message: NAK, this actually makes the code much worse. Two-tab indents are

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 7 repliesNAK

Patches in v1

#Subject and filesSizeRepliesApplied
1/12MAINTAINERS: add the sample directory to the configfs entryMAINTAINERS+1 -00 replies
2/12samples: configfs: order includes alphabeticallysamples/configfs/configfs_sample.c+1 -13 replies
3/12samples: configfs: remove redundant newlinessamples/configfs/configfs_sample.c+0 -60 replies
4/12samples: configfs: drop unnecessary ternary operatorssamples/configfs/configfs_sample.c+5 -50 replies
5/12samples: configfs: improve alignment of broken linessamples/configfs/configfs_sample.c+6 -61 reply
6/12samples: configfs: fix alignment in item structsamples/configfs/configfs_sample.c+1 -10 replies
7/12samples: configfs: replace simple_strtoul() with kstrtoint()samples/configfs/configfs_sample.c+9 -200 replies
8/12samples: configfs: don't reinitialize variables which are already zeroedsamples/configfs/configfs_sample.c+0 -20 replies
9/12samples: configfs: prefer sizeof(*var) to sizeof(struct var_type)samples/configfs/configfs_sample.c+2 -31 reply
10/12samples: configfs: consolidate local variables of the same typesamples/configfs/configfs_sample.c+1 -20 replies
11/12samples: configfs: don't use spaces before tabssamples/configfs/configfs_sample.c+1 -10 replies
12/12samples: configfs: prefer pr_err() over bare printk(KERN_ERRsamples/configfs/configfs_sample.c+2 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/12] samples: configfs: refactor the configfs sample code

From: Bartosz Golaszewski <[email protected]>

Over at the GPIO sub-system we have a testing module (gpio-mockup) which uses module params to instantiate simulated GPIO chips and debugfs to control them. We want to switch to a more stable interface using configfs to instantiate chips and sysfs to control them.

For that we need the feature that's well defined in the docs but currently unimplemented - committable items. I started working on this but it won't be ready for this release cycle.

In the meantime I also refactored the configfs samples a bit as I'll be adding sample code for committable items. I thought that it won't hurt to send the refactoring patches now for v5.10 so here it is. No logical changes really, mostly just code quality and removing usage of deprecated functions.

Bartosz Golaszewski (12):
MAINTAINERS: add the sample directory to the configfs entry
samples: configfs: order includes alphabetically
samples: configfs: remove redundant newlines
samples: configfs: drop unnecessary ternary operators
samples: configfs: improve alignment of broken lines
samples: configfs: fix alignment in item struct
samples: configfs: replace simple_strtoul() with kstrtoint()
samples: configfs: don't reinitialize variables which are already
zeroed
samples: configfs: prefer sizeof(*var) to sizeof(struct var_type)
samples: configfs: consolidate local variables of the same type
samples: configfs: don't use spaces before tabs
samples: configfs: prefer pr_err() over bare printk(KERN_ERR

 MAINTAINERS                        |  1 +
 samples/configfs/configfs_sample.c | 78 +++++++++++-------------------
 2 files changed, 29 insertions(+), 50 deletions(-)
Signature · 1 line
2.17.1