Changeset 3bacee1 in mainline for kernel/genarch


Ignore:
Timestamp:
2018-04-12T16:27:17Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3cf22f9
Parents:
76d0981d
git-author:
Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
git-committer:
Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
Message:

Make ccheck-fix again and commit more good files.

Location:
kernel/genarch/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/acpi/acpi.c

    r76d0981d r3bacee1  
    6565};
    6666
    67 static int rsdp_check(uint8_t *_rsdp) {
     67static int rsdp_check(uint8_t *_rsdp)
     68{
    6869        struct acpi_rsdp *rsdp = (struct acpi_rsdp *) _rsdp;
    6970        uint8_t sum = 0;
     
    119120        size_t i;
    120121        size_t j;
    121         size_t cnt = (acpi_rsdt->header.length - sizeof(struct acpi_sdt_header))
    122             / sizeof(uint32_t);
     122        size_t cnt = (acpi_rsdt->header.length - sizeof(struct acpi_sdt_header)) /
     123            sizeof(uint32_t);
    123124
    124125        for (i = 0; i < cnt; i++) {
    125                 for (j = 0; j < sizeof(signature_map)
    126                     / sizeof(struct acpi_signature_map); j++) {
     126                for (j = 0; j < sizeof(signature_map) /
     127                    sizeof(struct acpi_signature_map); j++) {
    127128                        struct acpi_sdt_header *hdr =
    128129                            (struct acpi_sdt_header *) (sysarg_t) acpi_rsdt->entry[i];
     
    145146        size_t i;
    146147        size_t j;
    147         size_t cnt = (acpi_xsdt->header.length - sizeof(struct acpi_sdt_header))
    148             / sizeof(uint64_t);
     148        size_t cnt = (acpi_xsdt->header.length - sizeof(struct acpi_sdt_header)) /
     149            sizeof(uint64_t);
    149150
    150151        for (i = 0; i < cnt; i++) {
    151                 for (j = 0; j < sizeof(signature_map)
    152                     / sizeof(struct acpi_signature_map); j++) {
     152                for (j = 0; j < sizeof(signature_map) /
     153                    sizeof(struct acpi_signature_map); j++) {
    153154                        struct acpi_sdt_header *hdr =
    154155                            (struct acpi_sdt_header *) ((uintptr_t) acpi_xsdt->entry[i]);
     
    184185        for (i = (ebda ? 0 : 1); i < 2; i++) {
    185186                for (j = 0; j < length[i]; j += 16) {
    186                         if ((*((uint64_t *) &addr[i][j]) == *sig)
    187                             && (rsdp_check(&addr[i][j]))) {
     187                        if ((*((uint64_t *) &addr[i][j]) == *sig) &&
     188                            (rsdp_check(&addr[i][j]))) {
    188189                                acpi_rsdp = (struct acpi_rsdp *) &addr[i][j];
    189190                                goto rsdp_found;
  • kernel/genarch/src/acpi/madt.c

    r76d0981d r3bacee1  
    225225                case MADT_IO_APIC:
    226226                        madt_io_apic_entry((struct madt_io_apic *) hdr, i);
    227                 break;
     227                        break;
    228228                case MADT_INTR_SRC_OVRD:
    229229                        madt_intr_src_ovrd_entry((struct madt_intr_src_ovrd *) hdr, i);
     
    240240                        break;
    241241                default:
    242                         if ((hdr->type >= MADT_RESERVED_SKIP_BEGIN)
    243                             && (hdr->type <= MADT_RESERVED_SKIP_END))
     242                        if ((hdr->type >= MADT_RESERVED_SKIP_BEGIN) &&
     243                            (hdr->type <= MADT_RESERVED_SKIP_END))
    244244                                log(LF_ARCH, LVL_NOTE,
    245245                                    "MADT: Skipping reserved entry (type=%" PRIu8 ")",
  • kernel/genarch/src/drivers/dsrln/dsrlnin.c

    r76d0981d r3bacee1  
    5656dsrlnin_instance_t *dsrlnin_init(dsrlnin_t *dev, inr_t inr)
    5757{
    58         dsrlnin_instance_t *instance
    59             = malloc(sizeof(dsrlnin_instance_t), FRAME_ATOMIC);
     58        dsrlnin_instance_t *instance =
     59            malloc(sizeof(dsrlnin_instance_t), FRAME_ATOMIC);
    6060        if (instance) {
    6161                instance->dsrlnin = dev;
  • kernel/genarch/src/drivers/ega/ega.c

    r76d0981d r3bacee1  
    547547        switch (ch) {
    548548        case '\n':
    549                 instance->cursor = (instance->cursor + EGA_COLS)
    550                     - instance->cursor % EGA_COLS;
     549                instance->cursor = (instance->cursor + EGA_COLS) -
     550                    instance->cursor % EGA_COLS;
    551551                break;
    552552        case '\t':
    553                 instance->cursor = (instance->cursor + 8)
    554                     - instance->cursor % 8;
     553                instance->cursor = (instance->cursor + 8) -
     554                    instance->cursor % 8;
    555555                break;
    556556        case '\b':
  • kernel/genarch/src/drivers/ns16550/ns16550.c

    r76d0981d r3bacee1  
    128128    cir_t cir, void *cir_arg, outdev_t **output)
    129129{
    130         ns16550_instance_t *instance
    131             = malloc(sizeof(ns16550_instance_t), FRAME_ATOMIC);
     130        ns16550_instance_t *instance =
     131            malloc(sizeof(ns16550_instance_t), FRAME_ATOMIC);
    132132        if (instance) {
    133133                instance->ns16550 = dev;
  • kernel/genarch/src/drivers/via-cuda/cuda.c

    r76d0981d r3bacee1  
    9090cuda_instance_t *cuda_init(cuda_t *dev, inr_t inr, cir_t cir, void *cir_arg)
    9191{
    92         cuda_instance_t *instance
    93             = malloc(sizeof(cuda_instance_t), FRAME_ATOMIC);
     92        cuda_instance_t *instance =
     93            malloc(sizeof(cuda_instance_t), FRAME_ATOMIC);
    9494        if (instance) {
    9595                instance->cuda = dev;
     
    168168
    169169        switch (instance->xstate) {
    170         case cx_listen: cuda_irq_listen(irq); break;
    171         case cx_receive: cuda_irq_receive(irq); break;
    172         case cx_rcv_end: cuda_irq_rcv_end(irq, rbuf, &len);
    173             handle = true; break;
    174         case cx_send_start: cuda_irq_send_start(irq); break;
    175         case cx_send: cuda_irq_send(irq); break;
     170        case cx_listen:
     171                cuda_irq_listen(irq);
     172                break;
     173        case cx_receive:
     174                cuda_irq_receive(irq);
     175                break;
     176        case cx_rcv_end:
     177                cuda_irq_rcv_end(irq, rbuf, &len);
     178                handle = true;
     179                break;
     180        case cx_send_start:
     181                cuda_irq_send_start(irq);
     182                break;
     183        case cx_send:
     184                cuda_irq_send(irq);
     185                break;
    176186        }
    177187
     
    314324static void cuda_packet_handle(cuda_instance_t *instance, uint8_t *data, size_t len)
    315325{
    316         if (data[0] != 0x00 || data[1] != 0x40 || (data[2] != 0x2c
    317                 && data[2] != 0x8c))
     326        if (data[0] != 0x00 || data[1] != 0x40 || (data[2] != 0x2c &&
     327            data[2] != 0x8c))
    318328                return;
    319329
  • kernel/genarch/src/fb/fb.c

    r76d0981d r3bacee1  
    8080        ((glyph) * (instance)->glyphbytes + (y) * (instance)->glyphscanline)
    8181
    82 typedef void (* rgb_conv_t)(void *, uint32_t);
     82typedef void (*rgb_conv_t)(void *, uint32_t);
    8383
    8484typedef struct {
     
    224224static void bgr_323(void *dst, uint32_t rgb)
    225225{
    226         *((uint8_t *) dst)
    227             = ~((RED(rgb, 3) << 5) | (GREEN(rgb, 2) << 3) | BLUE(rgb, 3));
     226        *((uint8_t *) dst) =
     227            ~((RED(rgb, 3) << 5) | (GREEN(rgb, 2) << 3) | BLUE(rgb, 3));
    228228}
    229229
  • kernel/genarch/src/kbrd/kbrd.c

    r76d0981d r3bacee1  
    171171kbrd_instance_t *kbrd_init(void)
    172172{
    173         kbrd_instance_t *instance
    174             = malloc(sizeof(kbrd_instance_t), FRAME_ATOMIC);
     173        kbrd_instance_t *instance =
     174            malloc(sizeof(kbrd_instance_t), FRAME_ATOMIC);
    175175        if (instance) {
    176176                instance->thread = thread_create(kkbrd, (void *) instance,
  • kernel/genarch/src/ofw/ofw_tree.c

    r76d0981d r3bacee1  
    106106         * Try to find the disambigued name.
    107107         */
    108         for (ofw_tree_node_t *cur = node->child; cur; cur = cur->peer) {
     108        for (ofw_tree_node_t * cur = node->child; cur; cur = cur->peer) {
    109109                if (str_cmp(cur->da_name, name) == 0)
    110110                        return cur;
     
    118118         * are not always fully-qualified.
    119119         */
    120         for (ofw_tree_node_t *cur = node->child; cur; cur = cur->peer) {
     120        for (ofw_tree_node_t * cur = node->child; cur; cur = cur->peer) {
    121121                if (str_cmp(ofw_tree_node_name(cur), name) == 0)
    122122                        return cur;
     
    138138    const char *dtype)
    139139{
    140         for (ofw_tree_node_t *cur = node->child; cur; cur = cur->peer) {
     140        for (ofw_tree_node_t * cur = node->child; cur; cur = cur->peer) {
    141141                ofw_tree_property_t *prop =
    142142                    ofw_tree_getprop(cur, "device_type");
     
    167167    phandle handle)
    168168{
    169         for (ofw_tree_node_t *cur = root; cur; cur = cur->peer) {
     169        for (ofw_tree_node_t * cur = root; cur; cur = cur->peer) {
    170170                if (cur->node_handle == handle)
    171171                        return cur;
     
    194194    const char *dtype)
    195195{
    196         for (ofw_tree_node_t *cur = node->peer; cur; cur = cur->peer) {
     196        for (ofw_tree_node_t * cur = node->peer; cur; cur = cur->peer) {
    197197                ofw_tree_property_t *prop =
    198198                    ofw_tree_getprop(cur, "device_type");
     
    220220    const char *name)
    221221{
    222         for (ofw_tree_node_t *cur = node->peer; cur; cur = cur->peer) {
     222        for (ofw_tree_node_t * cur = node->peer; cur; cur = cur->peer) {
    223223                ofw_tree_property_t *prop =
    224224                    ofw_tree_getprop(cur, "name");
     
    284284    const char *dtype, ofw_tree_walker_t walker, void *arg)
    285285{
    286         for (ofw_tree_node_t *cur = node; cur; cur = cur->peer) {
     286        for (ofw_tree_node_t * cur = node; cur; cur = cur->peer) {
    287287                ofw_tree_property_t *prop =
    288288                    ofw_tree_getprop(cur, "device_type");
     
    388388        char *cur_path = (char *) malloc(PATH_MAX_LEN, 0);
    389389
    390         for (ofw_tree_node_t *cur = node; cur; cur = cur->peer) {
     390        for (ofw_tree_node_t * cur = node; cur; cur = cur->peer) {
    391391                if ((cur->parent) && (path))
    392392                        snprintf(cur_path, PATH_MAX_LEN, "%s.%s", path, cur->da_name);
  • kernel/genarch/src/softint/division.c

    r76d0981d r3bacee1  
    5959        for (; steps > 0; steps--) {
    6060                /* shift one bit to remainder */
    61                 *remainder = ((*remainder) << 1) | (( a >> 31) & 0x1);
     61                *remainder = ((*remainder) << 1) | ((a >> 31) & 0x1);
    6262                result <<= 1;
    6363
  • kernel/genarch/src/srln/srln.c

    r76d0981d r3bacee1  
    129129srln_instance_t *srln_init(void)
    130130{
    131         srln_instance_t *instance
    132             = malloc(sizeof(srln_instance_t), FRAME_ATOMIC);
     131        srln_instance_t *instance =
     132            malloc(sizeof(srln_instance_t), FRAME_ATOMIC);
    133133        if (instance) {
    134134                instance->thread = thread_create(ksrln, (void *) instance,
Note: See TracChangeset for help on using the changeset viewer.