[lustre-devel] [PATCH 5/7] staging: lustre: osc_io.c: replace container_of0 by container_of
Aya Mahfouz
mahfouz.saif.elyazal at gmail.com
Tue Oct 13 15:24:19 PDT 2015
Replaces container_of0 by container_of. The only difference between
the two implementations is that container_of0 tries to evade
type casting if the pointer is erroneous or null. The use of
container_of is encouraged to bring lustre one step closer to
community standards.
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal at gmail.com>
---
drivers/staging/lustre/lustre/osc/osc_io.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/lustre/lustre/osc/osc_io.c b/drivers/staging/lustre/lustre/osc/osc_io.c
index 3a4200f..fb3b415 100644
--- a/drivers/staging/lustre/lustre/osc/osc_io.c
+++ b/drivers/staging/lustre/lustre/osc/osc_io.c
@@ -56,13 +56,13 @@
static struct osc_req *cl2osc_req(const struct cl_req_slice *slice)
{
LINVRNT(slice->crs_dev->cd_lu_dev.ld_type == &osc_device_type);
- return container_of0(slice, struct osc_req, or_cl);
+ return container_of(slice, struct osc_req, or_cl);
}
static struct osc_io *cl2osc_io(const struct lu_env *env,
const struct cl_io_slice *slice)
{
- struct osc_io *oio = container_of0(slice, struct osc_io, oi_cl);
+ struct osc_io *oio = container_of(slice, struct osc_io, oi_cl);
LINVRNT(oio == osc_env_io(env));
return oio;
--
2.4.2
--
Kind Regards,
Aya Saif El-yazal Mahfouz
More information about the lustre-devel
mailing list