[QUERY]drivers: pnp: isapnp:proc.c: assignment inside if statement

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

 



This is a code snippet from line 63 of drivers: pnp: isapnp: proc.c
This is an error I came across while looking through some checkpatch
errors.

if (!(de = bus->procdir)) {
                sprintf(name, "%02x", bus->number);
                de = bus->procdir = proc_mkdir(name, isapnp_proc_bus_dir);
                if (!de)
                        return -ENOMEM;
        }

In the above code snippet is assignment inside the if statement
necessary? Can the assignment be done outside the if statement as it is
a good coding style practice?
Is that change sufficient? I dont want to just shut checkpatch errors as I
really want to improve the code.

Thankyou for taking your time to go through this.

Anupama K Patil

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux