* [PATCH] staging: lustre: lustre: mdc: mdc_lib.c: Removed an unnecessary NULL check
@ 2014-12-17 22:42 Rickard Strandqvist
2014-12-18 9:14 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Rickard Strandqvist @ 2014-12-17 22:42 UTC (permalink / raw)
To: Oleg Drokin, Andreas Dilger
Cc: Rickard Strandqvist, Greg Kroah-Hartman, Srikrishan Malik,
Peng Tao, HPDD-discuss, devel, linux-kernel
Removed an unnecessary NULL check.
I have checked the only place this function is called from.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
drivers/staging/lustre/lustre/mdc/mdc_lib.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
index e8732cc..a798c2b 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
@@ -224,10 +224,9 @@ void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
rec->cr_fsuid = from_kuid(&init_user_ns, current_fsuid());
rec->cr_fsgid = from_kgid(&init_user_ns, current_fsgid());
rec->cr_cap = cfs_curproc_cap_pack();
- if (op_data != NULL) {
- rec->cr_fid1 = op_data->op_fid1;
- rec->cr_fid2 = op_data->op_fid2;
- }
+ rec->cr_fid1 = op_data->op_fid1;
+ rec->cr_fid2 = op_data->op_fid2;
+
rec->cr_mode = mode;
cr_flags = mds_pack_open_flags(flags, mode);
rec->cr_rdev = rdev;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: lustre: lustre: mdc: mdc_lib.c: Removed an unnecessary NULL check
2014-12-17 22:42 [PATCH] staging: lustre: lustre: mdc: mdc_lib.c: Removed an unnecessary NULL check Rickard Strandqvist
@ 2014-12-18 9:14 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2014-12-18 9:14 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Oleg Drokin, Andreas Dilger, Srikrishan Malik, devel,
Greg Kroah-Hartman, Peng Tao, linux-kernel, HPDD-discuss
On Wed, Dec 17, 2014 at 11:42:53PM +0100, Rickard Strandqvist wrote:
> Removed an unnecessary NULL check.
> I have checked the only place this function is called from.
Next time, in the changelog mention that the checking isn't consistent
so it creates as static checker warning. That is a good motivation for
writing these patches.
Anway, looks good.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-18 9:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-17 22:42 [PATCH] staging: lustre: lustre: mdc: mdc_lib.c: Removed an unnecessary NULL check Rickard Strandqvist
2014-12-18 9:14 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox