Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754048AbbHXHwb (ORCPT ); Mon, 24 Aug 2015 03:52:31 -0400 Received: from canardo.mork.no ([148.122.252.1]:42480 "EHLO canardo.mork.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752077AbbHXHw1 convert rfc822-to-8bit (ORCPT ); Mon, 24 Aug 2015 03:52:27 -0400 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Johan Hovold Cc: "Liu.Zhao" , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, konstantin@linuxfoundation.org, 398817832@qq.com, 278883616@qq.com, yang.haojun3@zte.com.cn Subject: Re: [PATCH v3 1/1] USB:option:add ZTE PIDs Organization: m References: <1439999477-3447-1-git-send-email-lzsos369@163.com> <20150824072636.GD14209@localhost> Date: Mon, 24 Aug 2015 09:51:33 +0200 In-Reply-To: <20150824072636.GD14209@localhost> (Johan Hovold's message of "Mon, 24 Aug 2015 09:26:36 +0200") Message-ID: <87a8th6s56.fsf@nemi.mork.no> User-Agent: Gnus/5.130013 (Ma Gnus v0.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (canardo.mork.no [IPv6:2001:4641::1]); Mon, 24 Aug 2015 09:51:40 +0200 (CEST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1531 Lines: 46 Johan Hovold writes: > On Wed, Aug 19, 2015 at 08:51:17AM -0700, Liu.Zhao wrote: >> >> #define BENQ_VENDOR_ID 0x04a5 >> #define BENQ_PRODUCT_H10 0x4068 >> @@ -544,6 +548,14 @@ static const struct option_blacklist_info zte_mc2716_z_blacklist = { >> .sendsetup = BIT(1) | BIT(2) | BIT(3), >> }; >> >> +static const struct option_blacklist_info zte_me3620andzm8620_xl_blacklist = { >> + .reserved = BIT(3) | BIT(4) | BIT(5), >> +}; > > Use two structs for this: zte_me3620_blacklist and zm8620_xl_blacklist > even if they reserve the same ports. Why? Wouldn't it be better to merge all identical lists and give them structured names describing their contents instead? E.g. static const struct option_blacklist_info bi_s0001_r = { .sendsetup = BIT(0) | BIT(1), }; static const struct option_blacklist_info bi_s0001_r04 = { .sendsetup = BIT(0) | BIT(1), .reserved = BIT(4), }; static const struct option_blacklist_info bi_s_r030405 = { .reserved = BIT(3) | BIT(4) | BIT(5), }; etc. Or some other naming scheme. I don't see the point of having lots of identical structs just to be able to name them after some rarely meaningful marketing name. Many vendors recycle their pids, making this completely futile. Bjørn -- 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/