Change formatting rules
This commit is contained in:
@@ -7,10 +7,10 @@
|
||||
#include <proc/reschedule.h>
|
||||
#include <status.h>
|
||||
|
||||
DEFINE_DEVICE_INIT (partdrv_init) {
|
||||
DEFINE_DEVICE_INIT(partdrv_init) {
|
||||
struct partdrv_init* init = arg;
|
||||
|
||||
struct partdrv* partdrv = malloc (sizeof (*partdrv));
|
||||
struct partdrv* partdrv = malloc(sizeof(*partdrv));
|
||||
|
||||
if (partdrv == NULL)
|
||||
return false;
|
||||
@@ -24,13 +24,13 @@ DEFINE_DEVICE_INIT (partdrv_init) {
|
||||
return true;
|
||||
}
|
||||
|
||||
DEFINE_DEVICE_FINI (partdrv_fini) {
|
||||
DEFINE_DEVICE_FINI(partdrv_fini) {
|
||||
struct partdrv* partdrv = device->udata;
|
||||
|
||||
free (partdrv);
|
||||
free(partdrv);
|
||||
}
|
||||
|
||||
DEFINE_DEVICE_OP (partdrv_read) {
|
||||
DEFINE_DEVICE_OP(partdrv_read) {
|
||||
uint64_t fs;
|
||||
|
||||
if (a1 == NULL || a2 == NULL || a3 == NULL)
|
||||
@@ -43,14 +43,14 @@ DEFINE_DEVICE_OP (partdrv_read) {
|
||||
size_t sector_count = *(size_t*)a2;
|
||||
uint8_t* buffer = a3;
|
||||
|
||||
spin_lock (&super->lock, &fs);
|
||||
int ret = device_op (super, XDRV_READ, proc, rctx, &fs, §or, §or_count, buffer);
|
||||
spin_unlock (&super->lock, fs);
|
||||
spin_lock(&super->lock, &fs);
|
||||
int ret = device_op(super, XDRV_READ, proc, rctx, &fs, §or, §or_count, buffer);
|
||||
spin_unlock(&super->lock, fs);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
DEFINE_DEVICE_OP (partdrv_write) {
|
||||
DEFINE_DEVICE_OP(partdrv_write) {
|
||||
uint64_t fs;
|
||||
|
||||
if (a1 == NULL || a2 == NULL || a3 == NULL)
|
||||
@@ -63,14 +63,14 @@ DEFINE_DEVICE_OP (partdrv_write) {
|
||||
size_t sector_count = *(size_t*)a2;
|
||||
uint8_t* buffer = a3;
|
||||
|
||||
spin_lock (&super->lock, &fs);
|
||||
int ret = device_op (super, XDRV_WRITE, proc, rctx, &fs, §or, §or_count, buffer);
|
||||
spin_unlock (&super->lock, fs);
|
||||
spin_lock(&super->lock, &fs);
|
||||
int ret = device_op(super, XDRV_WRITE, proc, rctx, &fs, §or, §or_count, buffer);
|
||||
spin_unlock(&super->lock, fs);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
DEFINE_DEVICE_OP (partdrv_get_device_type) {
|
||||
DEFINE_DEVICE_OP(partdrv_get_device_type) {
|
||||
if (a1 == NULL)
|
||||
return -ST_BAD_ADDRESS_SPACE;
|
||||
|
||||
@@ -81,7 +81,7 @@ DEFINE_DEVICE_OP (partdrv_get_device_type) {
|
||||
return ST_OK;
|
||||
}
|
||||
|
||||
DEFINE_DEVICE_OP (partdrv_get_sector_size) {
|
||||
DEFINE_DEVICE_OP(partdrv_get_sector_size) {
|
||||
uint64_t fs;
|
||||
|
||||
if (a1 == NULL)
|
||||
@@ -91,14 +91,14 @@ DEFINE_DEVICE_OP (partdrv_get_sector_size) {
|
||||
|
||||
struct partdrv* partdrv = device->udata;
|
||||
|
||||
spin_lock (&partdrv->super->lock, &fs);
|
||||
device_op (partdrv->super, XDRV_GET_SECTOR_SIZE, proc, rctx, &fs, secsize);
|
||||
spin_unlock (&partdrv->super->lock, fs);
|
||||
spin_lock(&partdrv->super->lock, &fs);
|
||||
device_op(partdrv->super, XDRV_GET_SECTOR_SIZE, proc, rctx, &fs, secsize);
|
||||
spin_unlock(&partdrv->super->lock, fs);
|
||||
|
||||
return ST_OK;
|
||||
}
|
||||
|
||||
DEFINE_DEVICE_OP (partdrv_get_size) {
|
||||
DEFINE_DEVICE_OP(partdrv_get_size) {
|
||||
if (a1 == NULL)
|
||||
return -ST_BAD_ADDRESS_SPACE;
|
||||
|
||||
@@ -111,4 +111,4 @@ DEFINE_DEVICE_OP (partdrv_get_size) {
|
||||
return ST_OK;
|
||||
}
|
||||
|
||||
DEFINE_DEVICE_OP (partdrv_partition_rescan) { return ST_OK; }
|
||||
DEFINE_DEVICE_OP(partdrv_partition_rescan) { return ST_OK; }
|
||||
|
||||
Reference in New Issue
Block a user