Re: [PATCH 1/4] option: convert interface blacklisting to bitfields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 08-09-2011 0:25, Dan Williams wrote:

It's cleaner than the array stuff, and we're about to add a bunch
more blacklist entries.  Second, there are devices that need both
the sendsetup and the reserved interface blacklists, which the
current code can't accommodate.

Signed-off-by: Dan Williams<dcbw@xxxxxxxxxx>
Cc: stable<stable@xxxxxxxxxx>
---
  drivers/usb/serial/option.c |   53 +++++++++++++++++++++----------------------
  1 files changed, 26 insertions(+), 27 deletions(-)

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 8156561..c3b458f 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
[...]
@@ -1157,21 +1150,28 @@ static int option_probe(struct usb_serial *serial,
  	return 0;
  }

-static enum option_blacklist_reason is_blacklisted(const u8 ifnum,
-				const struct option_blacklist_info *blacklist)
+static bool is_blacklisted(const u8 ifnum, enum option_blacklist_reason reason,
+			   const struct option_blacklist_info *blacklist)
  {
-	const u8  *info;
-	int i;
+	unsigned long num;
+	const unsigned long *intf_list;

  	if (blacklist) {
-		info = blacklist->ifaceinfo;
+		if (reason == OPTION_BLACKLIST_SENDSETUP)
+			intf_list =&blacklist->sendsetup;
+		else if (reason == OPTION_BLACKLIST_RESERVED_IF)
+			intf_list =&blacklist->reserved;
+		else {
+			BUG_ON(reason);
+			return false;
+		}

   This asks to be a *switch* statement...

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux