Re: [PATCH v3,4/5] misc: sram_dynamic for user level SRAM access

王文虎 wenhu.wang at vivo.com
Fri Apr 24 16:47:54 AEST 2020


>> diff --git a/include/linux/sram_dynamic.h b/include/linux/sram_dynamic.h
>> new file mode 100644
>> index 000000000000..c77e9e7b1151
>> --- /dev/null
>> +++ b/include/linux/sram_dynamic.h
>> @@ -0,0 +1,23 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +#ifndef __SRAM_DYNAMIC_H
>> +#define __SRAM_DYNAMIC_H
>> +
>> +struct sram_api {
>> +	const char	*name;
>> +	struct sram_device *sdev;
>> +	void *(*alloc)(__u32 size, phys_addr_t *phys, __u32 align);
>> +	void (*free)(void *ptr);
>> +};
>> +
>> +extern int __must_check
>> +	__sram_register_device(struct module *owner,
>> +			       struct device *parent,
>> +			       struct sram_api *sa);
>
>'extern' keyword is useless here, remove it (checkpatch --strict will 
>likely tell you the same)
>
>> +
>> +/* Use a define to avoid include chaining to get THIS_MODULE */
>> +#define sram_register_device(parent, sa) \
>> +	__sram_register_device(THIS_MODULE, parent, sa)
>> +
>> +extern void sram_unregister_device(struct sram_api *sa);
>
>Same, no 'extern' please.
>

Thanks, I will remove them in patch v4. And checkpatch with --strict will be prefered.

Wenhu



More information about the Linuxppc-dev mailing list