lkml.org 
[lkml]   [2005]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 16/42]: PCI: PCI Error reporting callbacks
Greg KH writes:

> > +enum pcierr_result {
> > + PCIERR_RESULT_NONE=0, /* no result/none/not supported in device driver */
> > + PCIERR_RESULT_CAN_RECOVER=1, /* Device driver can recover without slot reset */
> > + PCIERR_RESULT_NEED_RESET, /* Device driver wants slot to be reset. */
> > + PCIERR_RESULT_DISCONNECT, /* Device has completely failed, is unrecoverable */
> > + PCIERR_RESULT_RECOVERED, /* Device driver is fully recovered and operational */
> > +};
>
> No, do not create new types of error or return codes. Use the standard
> -EFOO values. You can document what they should each return, and mean,
> but do not create new codes.

Actually, these are not error or return codes, but rather requested
actions (maybe somewhat misnamed). We can map them on to -EFOO values
but it will be rather strained (-ECONNRESET for "please reset the
slot", anyone? :).

> Also, you create an enum, but yet do not use it in your function
> callback definition, which means you really didn't want to create it in
> the first place...

Yes, they could be #defines.

Paul.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-07 00:37    [from the cache]
©2003-2011 Jasper Spaans