On Fri, Nov 02, 2012 at 05:52:26PM +0100, walter harms wrote: > if i understand the code correct you can simply the flow > by turning the check on its head. > > ret = spi_sync(st->spi, &msg); > if (ret>=0) > *val = be16_to_cpu(st->data[1]); > mutex_unlock(&indio_dev->mlock); > return ret; It's better to always treat errors as the special case and success as the normal case. It makes the code more readable if every check is consistent. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html