Skip to content

Commit 992e10a

Browse files
committed
[Kernel] fix the compiling warning.
1 parent d219f5b commit 992e10a

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/device.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,20 @@ RTM_EXPORT(rt_device_find);
150150
*/
151151
rt_device_t rt_device_create(int type, int attach_size)
152152
{
153-
int size;
154-
rt_device_t device;
153+
int size;
154+
rt_device_t device;
155155

156-
size = RT_ALIGN(sizeof(struct rt_device), RT_ALIGN_SIZE);
157-
size += attach_size;
156+
size = RT_ALIGN(sizeof(struct rt_device), RT_ALIGN_SIZE);
157+
size += attach_size;
158158

159-
device = (rt_device_t)rt_malloc(size);
160-
if (device)
161-
{
162-
rt_memset(device, 0x0, sizeof(struct rt_device));
163-
device->type = type;
164-
}
159+
device = (rt_device_t)rt_malloc(size);
160+
if (device)
161+
{
162+
rt_memset(device, 0x0, sizeof(struct rt_device));
163+
device->type = (enum rt_device_class_type)type;
164+
}
165165

166-
return device;
166+
return device;
167167
}
168168
RTM_EXPORT(rt_device_create);
169169

@@ -174,11 +174,11 @@ RTM_EXPORT(rt_device_create);
174174
*/
175175
void rt_device_destroy(rt_device_t device)
176176
{
177-
/* unregister device firstly */
178-
rt_device_unregister(device);
177+
/* unregister device firstly */
178+
rt_device_unregister(device);
179179

180-
/* release this device object */
181-
rt_free(device);
180+
/* release this device object */
181+
rt_free(device);
182182
}
183183
RTM_EXPORT(rt_device_destroy);
184184
#endif

src/object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ rt_object_t rt_object_find(const char *name, rt_uint8_t type)
522522
/* try to find object */
523523
if (information == RT_NULL)
524524
{
525-
information = rt_object_get_information(type);
525+
information = rt_object_get_information((enum rt_object_class_type)type);
526526
RT_ASSERT(information != RT_NULL);
527527
}
528528
for (node = information->object_list.next;

0 commit comments

Comments
 (0)