mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
To: balbi@ti.com, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	joe@perches.com, auttamchandani@logicube.com,
	stern@rowland.harvard.edu
Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Subject: [PATCH 1/5] usb: gadget: net2280: Refactor queues_show
Date: Mon, 19 May 2014 21:11:29 +0200	[thread overview]
Message-ID: <1400526693-29776-2-git-send-email-ricardo.ribalda@gmail.com> (raw)
In-Reply-To: <1400526693-29776-1-git-send-email-ricardo.ribalda@gmail.com>

Replace a long and ugly expresion with an already available function.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
 drivers/usb/gadget/net2280.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index bd851de..c3205ec 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -1777,15 +1777,7 @@ static ssize_t queues_show(struct device *_dev, struct device_attribute *attr,
 				"\n%s (ep%d%s-%s) max %04x %s fifo %d\n",
 				ep->ep.name, t & USB_ENDPOINT_NUMBER_MASK,
 				(t & USB_DIR_IN) ? "in" : "out",
-				({ char *val;
-				 switch (d->bmAttributes & 0x03) {
-				 case USB_ENDPOINT_XFER_BULK:
-					val = "bulk"; break;
-				 case USB_ENDPOINT_XFER_INT:
-					val = "intr"; break;
-				 default:
-					val = "iso"; break;
-				 } val; }),
+				type_string(d->bmAttributes),
 				usb_endpoint_maxp (d) & 0x1fff,
 				ep->dma ? "dma" : "pio", ep->fifo_size
 				);
-- 
2.0.0.rc2


  reply	other threads:[~2014-05-19 19:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-19 19:11 [PATCH 0/5] usb: gadget: net2280: Code cleanout Ricardo Ribalda Delgado
2014-05-19 19:11 ` Ricardo Ribalda Delgado [this message]
2014-05-19 19:11 ` [PATCH 2/5] usb: gadget: net2280: Use S_I macros Ricardo Ribalda Delgado
2014-05-19 19:30   ` Alan Stern
2014-05-19 19:35     ` Ricardo Ribalda Delgado
2014-05-19 20:03       ` Alan Stern
2014-05-19 19:11 ` [PATCH 3/5] usb: gadget: net2280: Pass checkpacth.pl test Ricardo Ribalda Delgado
2014-05-19 19:39   ` Alan Stern
2014-05-20  8:52     ` David Laight
2014-05-20  8:55       ` Ricardo Ribalda Delgado
2014-05-19 19:11 ` [PATCH 4/5] usb: gadget: net2280: Code Cleanup Ricardo Ribalda Delgado
2014-05-19 19:43   ` Alan Stern
2014-05-19 19:44     ` Ricardo Ribalda Delgado
2014-05-19 20:02       ` Alan Stern
2014-05-19 19:11 ` [PATCH 5/5] usb: gadget: net2280: Use pr_* function Ricardo Ribalda Delgado
2014-05-19 19:16   ` Joe Perches
2014-05-19 19:33     ` Ricardo Ribalda Delgado
2014-05-19 19:42       ` Joe Perches
2014-05-19 19:43         ` Ricardo Ribalda Delgado
2014-05-19 19:44   ` Alan Stern
2014-05-19 20:03     ` Ricardo Ribalda Delgado
2014-05-19 20:17       ` Alan Stern
2014-05-19 20:29         ` Joe Perches
2014-05-19 20:41           ` Ricardo Ribalda Delgado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1400526693-29776-2-git-send-email-ricardo.ribalda@gmail.com \
    --to=ricardo.ribalda@gmail.com \
    --cc=auttamchandani@logicube.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®