davidker / unisys

Master repository for new changes to drivers/staging/unisys and drivers/visorbus
Other
2 stars 1 forks source link

(rc != 0) is a double negative [upstream] #2

Closed davidker closed 8 years ago

davidker commented 8 years ago

(rc != 0) needs to go, from everywhere

davidker commented 8 years ago

From Dan's email: Also "if (rc != 0)" is a double negative. != zero is good style when you are talking about the number zero or for strcmp() functions.

arfvidsonUIS commented 8 years ago

Fixed all !=0 except those for uuid comparisons. Just pushed the branch with the name upstream-double-negative.

Here is the list of the ones I fixed marked with xxxx

(11:22 rootx@ubuntu unisys) > find . -name "*.h" | xargs grep "!= 0"                                                                   
./include/channel.h:    if (uuid_le_cmp(expected_uuid, NULL_UUID_LE) != 0) {
./include/channel.h:            if (uuid_le_cmp(guid, expected_uuid) != 0) {
xxxx./include/channel.h:            if (readb(&hdr->cli_error_os) != 0) {
xxxx./include/channel.h:    if (readb(&hdr->cli_error_os) != 0) {
xxxx./include/channel.h:    if (readb(&hdr->cli_error_os) != 0) {
(11:22 rootx@ubuntu unisys) > find . -name "*.c" | xargs grep "!= 0"                                                                   
./visorbus/visorbus_main.c:          (uuid_le_cmp(drv->channel_types[i].guid, NULL_UUID_LE) != 0) ||
xxxx./visorbus/visorbus_main.c:     if (rc != 0)
./visorhba/visorhba_main.c:     if (!wait_event_timeout(notifyevent, notifyresult != 0xffff,
xxxx./visorinput/visorinput.c:              int old_state = (test_bit(led, visorinput_dev->led) != 0);
davidker commented 8 years ago

I want to keep this reopened until it gets into staging-next. Just in case we get yelled at by gregkh.

davidker commented 8 years ago

Transferred two of the patches over to upstream-next. I have not transferred 2ab6c11 as that one conflicts with upstream.

davidker commented 8 years ago

Greg accepted this into staging-testing so I'm closing this ticket.