OSDN Git Service

samples: configfs: drop unnecessary ternary operators
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Thu, 24 Sep 2020 12:45:18 +0000 (14:45 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 7 Oct 2020 13:44:51 +0000 (15:44 +0200)
commite0ee1fdb3fc49102e03c34527c5185b4761c7c8f
tree507524d687bc7d24e024b2e6565da8b080cd99a1
parent447243737c9d52d9c77fe0da0ed993903b64f28c
samples: configfs: drop unnecessary ternary operators

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/configfs_sample.c