kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Logging communication with devices
@ 2015-10-04 11:18 Peter Senna Tschudin
  2015-10-04 11:26 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Senna Tschudin @ 2015-10-04 11:18 UTC (permalink / raw)
  To: kernelnewbies

Does Linux provide an elegant and/or standard way of logging
communication with devices that manage buffers and that can help me
improve code like:

$ cat drivers/usb/host/fotg210-hcd.c
...
                temp = snprintf(next, size,
                                "\n\t%p%c%s len=%d %08x urb %p",
                                td, mark, ({ char *tmp;
                                 switch ((scratch>>8)&0x03) {
                                 case 0:
                                        tmp = "out";
                                        break;
                                 case 1:
                                        tmp = "in";
                                        break;
                                 case 2:
                                        tmp = "setup";
                                        break;
                                 default:
                                        tmp = "?";
                                        break;
                                 } tmp; }),
                                (scratch >> 16) & 0x7fff,
                                scratch,
                                td->urb);


-- 
Peter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-04 11:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-04 11:18 Logging communication with devices Peter Senna Tschudin
2015-10-04 11:26 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).