* Mike Christie (michaelc@xxxxxxxxxxx) wrote: >>> - if (q->queue == ERR_PTR(-ENOMEM)) >>> + if (IS_ERR(q->queue)) { >> >> This indeed solves the problem I had underlined before, but >> introduces a new one. Right now the only error returned by kfifo_init >> is -ENOMEM. This may however change in the future, and then the >> above code would silently convert the other error code to -ENOMEM. >> This might make it difficult to trace errors. > > What do you mean by converting other errors codes to -ENOMEM? Jean means the goto label...it will jump to essentially return -ENOMEM. >> I know this is all just theoretical, at the moment your code is >> correct, but I don't much like relying on assumptions which are not >> guaranteed to last. So I would rather cleanly transmit the error code >> up to the caller, or change the calling convention of kfifo_init() to > > What do you mean by cleanly transmitting the error code up the caller? It's handwavy here...meaning if kfifo_init returned some other error for some other condition, propagating that up the stack to the iscsi_pool_init() caller. Probably not all that critical to return ENOMEM vs someother errno in this case. thanks, -chris -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html