>>> Aastha Mehta <[email protected]> schrieb am 03.09.2011 um 07:50 in 
>>> Nachricht
<caex9m45bx_tzjconvwdobqjjqzmuqqfpufc8rgjxdk+n52-...@mail.gmail.com>:
> Hi,
> 
> Thanks for the suggestions. There is already an enumeration of the error
> codes given in the iscsi_if.h. The #defines cannot use the same names, but
> it can be done with slightly different names.
> So I shall modify the following things in the code -
> 1. #define the error messages and use those
> 2. Make the variable err_table[] as static const char *err_table[] inside
> the function err_code_to_string().
> 
> Is there anything else I should do?

I wondered: If the strings are used exactly once in one routine, you might add 
the strings right inside each "case".

> 
> Regards,
> Aastha.
> 
> On 2 September 2011 12:15, Ulrich Windl
> <[email protected]>wrote:
> 
> > >>> Aastha Mehta <[email protected]> schrieb am 31.08.2011 um 18:57 in
> > Nachricht
> > <CAEx9m44_UGavmNQ-Z8gdutsk-ZRSFZ+nKeBG+YGSK=vxdnn...@mail.gmail.com>:
> > > Hello,
> > >
> > > Attached is the patch for the first kernel TODO item in the TODO list
> > > circulated earlier. I could not send the patch through git send-email, so
> > > have attached it here.
> >
> > Hi!
> >
> > Why not having "char *err_table[NUM_ERRORS]"
> >
> > as a "static" variable inside char *err_code_to_string(int code)? Also why
> > not use "const char *err_table[...]"?
> >
> > Did you also try "git diff --check" before commit? You have at least one
> > "white space only" diff (utils/fwparam_ibft/prom_lex.c).
> >
> > I also wonder whether it wouldn't amke more sense to have #defines like
> > #define ISCSI_OK "ISCSI_OK: iscsi ok"
> >
> > and use them for err_table like this:
> >
> > const char *err_table[NUM_ERRORS] = {
> >    ISCSI_OK,
> >    ...
> > };
> >
> > Regards,
> > Ulrich
> >
> >
> > >
> > > Thanks,
> > > Aastha.
> >
> >
> >
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "open-iscsi" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> > http://groups.google.com/group/open-iscsi?hl=en.
> >
> >
> 



 

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to