Merge branch 'remotes/lorenzo/pci/dwc'
[linux-2.6-microblaze.git] / drivers / pci / p2pdma.c
index 64ebed1..85fc993 100644 (file)
@@ -53,7 +53,7 @@ static ssize_t size_show(struct device *dev, struct device_attribute *attr,
        if (pdev->p2pdma->pool)
                size = gen_pool_size(pdev->p2pdma->pool);
 
-       return snprintf(buf, PAGE_SIZE, "%zd\n", size);
+       return scnprintf(buf, PAGE_SIZE, "%zd\n", size);
 }
 static DEVICE_ATTR_RO(size);
 
@@ -66,7 +66,7 @@ static ssize_t available_show(struct device *dev, struct device_attribute *attr,
        if (pdev->p2pdma->pool)
                avail = gen_pool_avail(pdev->p2pdma->pool);
 
-       return snprintf(buf, PAGE_SIZE, "%zd\n", avail);
+       return scnprintf(buf, PAGE_SIZE, "%zd\n", avail);
 }
 static DEVICE_ATTR_RO(available);
 
@@ -75,8 +75,8 @@ static ssize_t published_show(struct device *dev, struct device_attribute *attr,
 {
        struct pci_dev *pdev = to_pci_dev(dev);
 
-       return snprintf(buf, PAGE_SIZE, "%d\n",
-                       pdev->p2pdma->p2pmem_published);
+       return scnprintf(buf, PAGE_SIZE, "%d\n",
+                        pdev->p2pdma->p2pmem_published);
 }
 static DEVICE_ATTR_RO(published);
 
@@ -761,7 +761,7 @@ struct scatterlist *pci_p2pmem_alloc_sgl(struct pci_dev *pdev,
        struct scatterlist *sg;
        void *addr;
 
-       sg = kzalloc(sizeof(*sg), GFP_KERNEL);
+       sg = kmalloc(sizeof(*sg), GFP_KERNEL);
        if (!sg)
                return NULL;