Skip to content

Commit

Permalink
nvdimm: Remove empty if statement
Browse files Browse the repository at this point in the history
This patch removes an empty statement from an if expression and promotes
the else statement to the if expression with the expression logic reversed.

I feel this is more readable as the empty statement can lead to issues if
any additional logic was ever added.

Reviewed-by: Toshi Kani <toshi.kani@hpe.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Alexander Duyck authored and djbw committed Oct 12, 2018
1 parent 1cfeb66 commit 19418b0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/nvdimm/label.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,8 @@ int nd_label_validate(struct nvdimm_drvdata *ndd)
void nd_label_copy(struct nvdimm_drvdata *ndd, struct nd_namespace_index *dst,
struct nd_namespace_index *src)
{
if (dst && src)
/* pass */;
else
/* just exit if either destination or source is NULL */
if (!dst || !src)
return;

memcpy(dst, src, sizeof_namespace_index(ndd));
Expand Down

0 comments on commit 19418b0

Please sign in to comment.