]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - lib/scatterlist.c
ufs: remove spurious scsi_set_tag_type call
[mirror_ubuntu-zesty-kernel.git] / lib / scatterlist.c
index b4415fceb7e7706ef5de6a9d78c413cd826f25ee..c9f2e8c6ccc996c8a40bac6872749185170ec7f9 100644 (file)
@@ -73,7 +73,7 @@ EXPORT_SYMBOL(sg_nents);
  **/
 struct scatterlist *sg_last(struct scatterlist *sgl, unsigned int nents)
 {
-#ifndef ARCH_HAS_SG_CHAIN
+#ifndef CONFIG_ARCH_HAS_SG_CHAIN
        struct scatterlist *ret = &sgl[nents - 1];
 #else
        struct scatterlist *sg, *ret = NULL;
@@ -203,10 +203,10 @@ void __sg_free_table(struct sg_table *table, unsigned int max_ents,
                }
 
                table->orig_nents -= sg_size;
-               if (!skip_first_chunk) {
-                       free_fn(sgl, alloc_size);
+               if (skip_first_chunk)
                        skip_first_chunk = false;
-               }
+               else
+                       free_fn(sgl, alloc_size);
                sgl = next;
        }
 
@@ -255,7 +255,7 @@ int __sg_alloc_table(struct sg_table *table, unsigned int nents,
 
        if (nents == 0)
                return -EINVAL;
-#ifndef ARCH_HAS_SG_CHAIN
+#ifndef CONFIG_ARCH_HAS_SG_CHAIN
        if (WARN_ON_ONCE(nents > max_ents))
                return -EINVAL;
 #endif