mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-15 10:37:46 +07:00
dma-debug: code style fixes
This patch changes the recent updates to dma-debug to conform with coding style guidelines of Linux and the -tip tree. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
This commit is contained in:
parent
3123250947
commit
c17e2cf737
@ -501,8 +501,8 @@ static int prealloc_memory(u32 num_entries)
|
|||||||
static ssize_t filter_read(struct file *file, char __user *user_buf,
|
static ssize_t filter_read(struct file *file, char __user *user_buf,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
|
||||||
char buf[NAME_MAX_LEN + 1];
|
char buf[NAME_MAX_LEN + 1];
|
||||||
|
unsigned long flags;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if (!current_driver_name[0])
|
if (!current_driver_name[0])
|
||||||
@ -523,9 +523,9 @@ static ssize_t filter_read(struct file *file, char __user *user_buf,
|
|||||||
static ssize_t filter_write(struct file *file, const char __user *userbuf,
|
static ssize_t filter_write(struct file *file, const char __user *userbuf,
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
|
||||||
char buf[NAME_MAX_LEN];
|
char buf[NAME_MAX_LEN];
|
||||||
size_t len = NAME_MAX_LEN - 1;
|
unsigned long flags;
|
||||||
|
size_t len;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -534,7 +534,7 @@ static ssize_t filter_write(struct file *file, const char __user *userbuf,
|
|||||||
* disabled. Since copy_from_user can fault and may sleep we
|
* disabled. Since copy_from_user can fault and may sleep we
|
||||||
* need to copy to temporary buffer first
|
* need to copy to temporary buffer first
|
||||||
*/
|
*/
|
||||||
len = min(count, len);
|
len = min(count, NAME_MAX_LEN - 1);
|
||||||
if (copy_from_user(buf, userbuf, len))
|
if (copy_from_user(buf, userbuf, len))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
@ -1040,11 +1040,10 @@ EXPORT_SYMBOL(debug_dma_map_sg);
|
|||||||
|
|
||||||
static int get_nr_mapped_entries(struct device *dev, struct scatterlist *s)
|
static int get_nr_mapped_entries(struct device *dev, struct scatterlist *s)
|
||||||
{
|
{
|
||||||
struct dma_debug_entry *entry;
|
struct dma_debug_entry *entry, ref;
|
||||||
struct hash_bucket *bucket;
|
struct hash_bucket *bucket;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int mapped_ents = 0;
|
int mapped_ents;
|
||||||
struct dma_debug_entry ref;
|
|
||||||
|
|
||||||
ref.dev = dev;
|
ref.dev = dev;
|
||||||
ref.dev_addr = sg_dma_address(s);
|
ref.dev_addr = sg_dma_address(s);
|
||||||
@ -1052,6 +1051,8 @@ static int get_nr_mapped_entries(struct device *dev, struct scatterlist *s)
|
|||||||
|
|
||||||
bucket = get_hash_bucket(&ref, &flags);
|
bucket = get_hash_bucket(&ref, &flags);
|
||||||
entry = hash_bucket_find(bucket, &ref);
|
entry = hash_bucket_find(bucket, &ref);
|
||||||
|
mapped_ents = 0;
|
||||||
|
|
||||||
if (entry)
|
if (entry)
|
||||||
mapped_ents = entry->sg_mapped_ents;
|
mapped_ents = entry->sg_mapped_ents;
|
||||||
put_hash_bucket(bucket, &flags);
|
put_hash_bucket(bucket, &flags);
|
||||||
|
Loading…
Reference in New Issue
Block a user