Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1061192rdg; Fri, 11 Aug 2023 08:31:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEH/tqzGldJfeojSSzPGhYQ5JvmK7SCDMrIMT//O/eAbfnYcTW7Qfxx12Chd3PTFyy76HHh X-Received: by 2002:a05:6512:2349:b0:4f8:64f5:f591 with SMTP id p9-20020a056512234900b004f864f5f591mr1896577lfu.12.1691767910153; Fri, 11 Aug 2023 08:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691767910; cv=none; d=google.com; s=arc-20160816; b=XtM70ZqJgL0FZWYc1X+ZfgkUblP5C3PCotERDY31UQuwQNi3CTs1xvSMVB7EdZBumj aa1Q3PpHg134znEZ0u64VDktZ+cUy8OyvBBsOZqMJLkJGfEhdHiKTbTRSZ/eWtS2SmLe KAUEDGxX+k5f1vVB6XhetbOrQ15zaiaUty6k4ozTQWSseDEh7pN8S+xXOfqJlh3i4T2V 1zF46g/xwbZDHUZ026II+rp3dl/1JrZH8U62XseSnls4sXqq7t1xfaE8iqpaudkTYzHn JF0JQLWiHq5/8I/A6H0G58Yfps5e4oNIc087dYuQ8ou4vK9Um2vfD4GeTY2zIH7c++r0 R8sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=x7UVwaSHqvbQlAi5Ly2d2NcyhsZBsaJcGkjSRC5KAaA=; fh=+8iAtIeO4vQNEPpCDTGWyBQv2eam1tGQ/YB/woiZDes=; b=AROmBDAE5gDDBRqQoGig3RSJZwNGJkcU5WWwUEO4DD7IEOBBZGKkyNlT0ahPta9gSf J6EMt5562OKxlMVr/XG7KQYMUw7/l6ZWic1eOfw/OuZzGmV/G/VU8VkDArSursSCoZo1 Y7NOAqvqhqD6AmP0CYU88hzG5IpsLiU30rofXnx0o0vIxZkDiEhDqAbAsgeB38XCj3BV AsgfJZFTCsO6KQCbN3EQwpPnLrPBGBR1R5LtdFqZ3fJ+h3wV7jTwBOTg3J7mRybevg8C wjRFIHKur/Mve433Su+EXpdD8xxa3zWxDpZl6jcy+UmEbR9UBwkkmmqcBQhekDTC/Uv4 oFXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CcMp5HuT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p4-20020a056402074400b0052336e17249si3534034edy.64.2023.08.11.08.31.24; Fri, 11 Aug 2023 08:31:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CcMp5HuT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236020AbjHKOaO (ORCPT + 99 others); Fri, 11 Aug 2023 10:30:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235467AbjHKOaM (ORCPT ); Fri, 11 Aug 2023 10:30:12 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FCB02728; Fri, 11 Aug 2023 07:30:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691764212; x=1723300212; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=FUo3SmG4D+rVXIoe4dtN9MY0CACMsCcU7kUpx9H9i2E=; b=CcMp5HuToh6AT6MxNBUqu6MPvz+nITaYhh2DzaRF5aGGujoJfmC9sDQD oYJsvuVC97CMCxI9Vskwc5X/oSV8j9LOJPU3NOWg9tPZgTcVGHcDjX0NK 8vNcnquQ8Hh3QeXa4G8p31azrSLjkE8pkPAj//TTImtRlH2k738uoZRKu Hw0AYlMBYYTiyQcQauvt6ZealfLlxcC3/4tf+7s3AWDatAV1wSUCy7PYm Oy4uD3CVnNi2bk1DS0UMXp9fgnLX6IGAANrtIaG5dYeyrjF8AaHeNaMh1 APYwPfCUzaVN8p6BqwWKv7STR/pWO+dwQ5iIcGfqjUwA0Wb66qkNgj8wa g==; X-IronPort-AV: E=McAfee;i="6600,9927,10799"; a="370586495" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="370586495" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2023 07:30:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10799"; a="735808482" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="735808482" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga007.fm.intel.com with ESMTP; 11 Aug 2023 07:30:04 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qUT9O-001HgB-0J; Fri, 11 Aug 2023 17:30:02 +0300 Date: Fri, 11 Aug 2023 17:30:01 +0300 From: Andy Shevchenko To: Biju Das Cc: Jonathan Cameron , "linux-kernel@vger.kernel.org" , Peter Rosin , Dmitry Torokhov , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , Alexandre Belloni , "Rafael J. Wysocki" , "linux-acpi@vger.kernel.org" , Andi Shyti , Wolfram Sang , Geert Uytterhoeven , "linux-rtc@vger.kernel.org" , "linux-iio@vger.kernel.org" , "linux-i2c@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" Subject: Re: [PATCH v7 0/4] Extend device_get_match_data() to struct bus_type Message-ID: References: <20230805174036.129ffbc2@jic23-huawei> <20230806142950.6c409600@jic23-huawei> <20230809182551.7eca502e@jic23-huawei> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 11, 2023 at 01:27:36PM +0000, Biju Das wrote: > > On Thu, Aug 10, 2023 at 09:05:10AM +0000, Biju Das wrote: ... > > I'm good with this approach, but make sure you checked the whole kernel > > source tree for a such. > > Checking against 16 is too short I guess?? > > drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h has 18 enums. So, what does prevent us from moving that tables to use pointers? > /*device enum */ > enum inv_devices { > INV_MPU6050, > INV_MPU6500, > INV_MPU6515, > INV_MPU6880, > INV_MPU6000, > INV_MPU9150, > INV_MPU9250, > INV_MPU9255, > INV_ICM20608, > INV_ICM20608D, > INV_ICM20609, > INV_ICM20689, > INV_ICM20600, > INV_ICM20602, > INV_ICM20690, > INV_IAM20680, > INV_NUM_PARTS > }; > > The new helper function You mean for debugging? We don't need that in production. I think what you need is a coccinelle script to find these. -- With Best Regards, Andy Shevchenko