Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754318AbbGXGt2 (ORCPT ); Fri, 24 Jul 2015 02:49:28 -0400 Received: from smtp2.provo.novell.com ([137.65.250.81]:39348 "EHLO smtp2.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751500AbbGXGtU (ORCPT ); Fri, 24 Jul 2015 02:49:20 -0400 From: Petr Tesarik To: Johan Hovold , Greg Kroah-Hartman Cc: Petr Tesarik , linux-usb@vger.kernel.org (open list:USB SERIAL SUBSYSTEM), linux-kernel@vger.kernel.org (open list), Petr Tesarik Subject: [PATCH 1/4] cp210x: Replace USB magic numbers with symbolic names Date: Fri, 24 Jul 2015 08:48:08 +0200 Message-Id: <1437720491-28702-2-git-send-email-ptesarik@suse.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1437720491-28702-1-git-send-email-ptesarik@suse.com> References: <1437720491-28702-1-git-send-email-ptesarik@suse.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1525 Lines: 46 From: Petr Tesarik The request type is in fact made of three fields that already have symbolic constants. While I was rewriting those lines, I also converted the pre-processor defines into an enum, so they are seen by debuggers. Signed-off-by: Petr Tesarik --- drivers/usb/serial/cp210x.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index eac7cca..1bae015 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -226,10 +226,16 @@ static struct usb_serial_driver * const serial_drivers[] = { }; /* Config request types */ -#define REQTYPE_HOST_TO_INTERFACE 0x41 -#define REQTYPE_INTERFACE_TO_HOST 0xc1 -#define REQTYPE_HOST_TO_DEVICE 0x40 -#define REQTYPE_DEVICE_TO_HOST 0xc0 +enum cp210x_request_type { + REQTYPE_HOST_TO_INTERFACE = + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, + REQTYPE_INTERFACE_TO_HOST = + USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, + REQTYPE_HOST_TO_DEVICE = + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, + REQTYPE_DEVICE_TO_HOST = + USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, +}; /* Config request codes */ #define CP210X_IFC_ENABLE 0x00 -- 2.1.4 -- 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/