NFC: digital: Fix incorrect use of ERR_PTR and PTR_ERR macros
authorThierry Escande <thierry.escande@linux.intel.com>
Thu, 2 Jan 2014 10:58:13 +0000 (11:58 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Sat, 4 Jan 2014 02:35:34 +0000 (03:35 +0100)
It's bad to use these macros when not dealing with error code. this
patch changes calls to these macros with correct casts.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
net/nfc/digital_dep.c

index 07bbc24fb4c73e39f79c8e5b70c34d95338b04c3..e42ecb66e7122a9d4d213d6cfcfdce8108f8a8e6 100644 (file)
@@ -472,7 +472,7 @@ int digital_tg_send_dep_res(struct nfc_digital_dev *ddev, struct sk_buff *skb)
 static void digital_tg_send_psl_res_complete(struct nfc_digital_dev *ddev,
                                             void *arg, struct sk_buff *resp)
 {
-       u8 rf_tech = PTR_ERR(arg);
+       u8 rf_tech = (unsigned long)arg;
 
        if (IS_ERR(resp))
                return;
@@ -508,7 +508,7 @@ static int digital_tg_send_psl_res(struct nfc_digital_dev *ddev, u8 did,
        ddev->skb_add_crc(skb);
 
        rc = digital_tg_send_cmd(ddev, skb, 0, digital_tg_send_psl_res_complete,
-                                ERR_PTR(rf_tech));
+                                (void *)(unsigned long)rf_tech);
 
        if (rc)
                kfree_skb(skb);