Vladimir Dergachev wrote:
> 
> I have been going through R300 drm source trying to implement all the
> suggestions that people offerred.
> 
> I am having some hard time with 80 column rule. Now, in general, I agree
> with it and it makes sense. However take a look at the following piece
> of code:
> 
> /******** snip ***** line 264 r300_cmdbuf.c ********/
>     for(i=0;i<sz;i++){
>         values[i]=((int __user*)cmdbuf->buf)[i];
>         switch(r300_reg_flags[(reg>>2)+i]){
>             case MARK_SAFE:
>                 break;
>             case MARK_CHECK_OFFSET:
>                 if(r300_check_offset(dev_priv, (u32)values[i])){
>                     DRM_ERROR("Offset failed range check (reg=%04x
> sz=%d)\n", reg, sz);
>                     return DRM_ERR(EINVAL);
>                     }
>                 break;
> /******** snip ************************************/
> 
> To me it looks perfectly fine - we have a for cycle, a switch statement
> inside and an error check in one of switch statement clauses. I don't
> see how separating these out into other functions is going to improve
> readability.
> 
> Problem is that there is no sane way I can fit the error message in 80
> columns without being cryptic.
> 
> Any ideas ?
> 
>                        thank you !
> 
>                               Vladimir Dergachev
> 
> 


                     DRM_ERROR("Offset failed range check "
                               "(reg=%04x sz=%d)\n", reg, sz);

Is this what you need?
-- 
Pedro Ramalhais


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to