Re: [PATCH 09/69] staging: unisys: refactor create_bus()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 5, 2014 at 5:08 PM, Benjamin Romer
<benjamin.romer@xxxxxxxxxx> wrote:
> Fix the missing braces and logical continuation problems in create_bus().
>
> Signed-off-by: Ken Depro <kenneth.depro@xxxxxxxxxx>
> Signed-off-by: Benjamin Romer <benjamin.romer@xxxxxxxxxx>
> ---
>  drivers/staging/unisys/uislib/uislib.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c
> index f25dd2f..1ddbe78 100644
> --- a/drivers/staging/unisys/uislib/uislib.c
> +++ b/drivers/staging/unisys/uislib/uislib.c
> @@ -192,8 +192,10 @@ create_bus(struct controlvm_message *msg, char *buf)
>                 bus->guest_handle = 0;
>                 bus->bus_no = busNo;
>                 bus->local_vnic = 1;
> -       } else
> -               bus->bus_no = bus->guest_handle = busNo;
> +       } else {
> +               bus->bus_no = busNo;
> +               bus->guest_handle = busNo;

You might consider not using camel case letters..

> +       }
>         sprintf(bus->name, "%d", (int)bus->bus_no);
>         bus->device_count = deviceCount;
>         bus->device =
> @@ -220,8 +222,8 @@ create_bus(struct controlvm_message *msg, char *buf)
>                 kfree(bus);
>                 return CONTROLVM_RESP_ERROR_ALREADY_DONE;
>         }
> -       if ((msg->cmd.create_bus.channel_addr != 0)
> -           && (msg->cmd.create_bus.channel_bytes != 0)) {
> +       if ((msg->cmd.create_bus.channel_addr != 0) &&
> +           (msg->cmd.create_bus.channel_bytes != 0)) {

This check can be written as

   +       if (msg->cmd.create_bus.channel_addr &&
   +           msg->cmd.create_bus.channel_bytes) {


>                 bus->bus_channel_bytes = msg->cmd.create_bus.channel_bytes;
>                 bus->bus_channel =
>                     init_vbus_channel(msg->cmd.create_bus.channel_addr,
> @@ -256,9 +258,9 @@ create_bus(struct controlvm_message *msg, char *buf)
>
>         /* add bus at the head of our list */
>         write_lock(&BusListLock);
> -       if (!BusListHead)
> +       if (!BusListHead) {

please try not to use camel case letters...

>                 BusListHead = bus;
> -       else {
> +       } else {
>                 bus->next = BusListHead;
>                 BusListHead = bus;
>         }
> --
> 2.1.0
>
> _______________________________________________
> devel mailing list
> devel@xxxxxxxxxxxxxxxxxxxxxx
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux