]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0059-target-Clean-up-returning-errors-in-PR-handling-code.patch
linux-ti33x-psp 3.2: update to 3.2.25
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.24 / 0059-target-Clean-up-returning-errors-in-PR-handling-code.patch
1 From ab68c7b575aff70124f83d2ec207d06c60eea003 Mon Sep 17 00:00:00 2001
2 From: Roland Dreier <roland@purestorage.com>
3 Date: Mon, 16 Jul 2012 15:17:10 -0700
4 Subject: [PATCH 059/109] target: Clean up returning errors in PR handling
5  code
7 commit d35212f3ca3bf4fb49d15e37f530c9931e2d2183 upstream.
9  - instead of (PTR_ERR(file) < 0) just use IS_ERR(file)
10  - return -EINVAL instead of EINVAL
11  - all other error returns in target_scsi3_emulate_pr_out() use
12    "goto out" -- get rid of the one remaining straight "return."
14 Signed-off-by: Roland Dreier <roland@purestorage.com>
15 Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
16 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
17 ---
18  drivers/target/target_core_pr.c |    7 ++++---
19  1 files changed, 4 insertions(+), 3 deletions(-)
21 diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
22 index b75bc92..9145141 100644
23 --- a/drivers/target/target_core_pr.c
24 +++ b/drivers/target/target_core_pr.c
25 @@ -2042,7 +2042,7 @@ static int __core_scsi3_write_aptpl_to_file(
26         if (IS_ERR(file) || !file || !file->f_dentry) {
27                 pr_err("filp_open(%s) for APTPL metadata"
28                         " failed\n", path);
29 -               return (PTR_ERR(file) < 0 ? PTR_ERR(file) : -ENOENT);
30 +               return IS_ERR(file) ? PTR_ERR(file) : -ENOENT;
31         }
32  
33         iov[0].iov_base = &buf[0];
34 @@ -3853,7 +3853,7 @@ int target_scsi3_emulate_pr_out(struct se_task *task)
35                         " SPC-2 reservation is held, returning"
36                         " RESERVATION_CONFLICT\n");
37                 cmd->scsi_sense_reason = TCM_RESERVATION_CONFLICT;
38 -               ret = EINVAL;
39 +               ret = -EINVAL;
40                 goto out;
41         }
42  
43 @@ -3863,7 +3863,8 @@ int target_scsi3_emulate_pr_out(struct se_task *task)
44          */
45         if (!cmd->se_sess) {
46                 cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
47 -               return -EINVAL;
48 +               ret = -EINVAL;
49 +               goto out;
50         }
51  
52         if (cmd->data_length < 24) {
53 -- 
54 1.7.7.6