Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp648759rwl; Thu, 5 Jan 2023 02:32:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXviko8xNR+xF1+TpH7n388OTLMsl7k6Pe5KZRfJx7XWWij5SFHe/f+VXus7KrBvChcbjIlQ X-Received: by 2002:a05:6402:291a:b0:48b:c8de:9d1a with SMTP id ee26-20020a056402291a00b0048bc8de9d1amr15741011edb.37.1672914777410; Thu, 05 Jan 2023 02:32:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672914777; cv=none; d=google.com; s=arc-20160816; b=HEQbrrsPMJB+QyodtLaIdIPiWPcR7isT2wk+QG0tt9ivWW2Sj7ynUxCP5kcDvikoJ4 DPHBJVJ6r8J66gWD3Yyw949raqMAlT8cTMzJx04VN7sxwic0Y94/K6PsdKPuoKZVmkd3 2H7x5XKrtFhZzGVcBFaZq820egDUWmwmKMh4pIy6l+pWJNls6UUEstEEp6K7lVUmZ8zO bdhMPl19VM5Q4kk2HzlD/zGhf9Xv4aZ+lB9gqwmAUobIxZs6wBFyyU4L0TAAp0r1PP3H Z3t78IeZE5LDIMWa67l0MRsU2oqa+ezej5E4B8W4vlnHNqvOqTLSZr4Z0wSgDAe6ZvvH IDyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=vkUFRUGyZmCOxQi/gP4WPvY79wi9RXTgSsTnq3KJqzk=; b=wcjj1W/ouG7FAp/EQkiTcULtiYaxyFn6WbOZ/ywlYOaVsZeAoqYlWUt0CwTRdn+hfl c7yCirpEvZm1+Aqkbx0nt1+Cy7FEdZE2Cd+gDDQKDDwhBVke3NmtXnPf+SSlhVB6oNhy OV4hUtXG2FEFeTaS0nuiIS/2d1Gtw++tmNcD84fzQUDQF+rxG0rTpg2YjumdpVPYgerp A3Ltr8jdsQ2l8zUytr6WlaySl6GHHQHjDnahTpudXgojft9ForfDljQJu6kjxhoRzdDQ CNoETjqd6jLZv16XOqgi4PQgNiTrBcCreJ1KWdSu8BP9W7Zy+RfNEVficR9jnigV3VW1 +jNQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg9-20020a170907970900b007c131ef0c41si32613063ejc.635.2023.01.05.02.32.44; Thu, 05 Jan 2023 02:32:57 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232453AbjAEJ6s convert rfc822-to-8bit (ORCPT + 55 others); Thu, 5 Jan 2023 04:58:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232320AbjAEJ6H (ORCPT ); Thu, 5 Jan 2023 04:58:07 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A8774FD5D; Thu, 5 Jan 2023 01:58:06 -0800 (PST) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Nnhg730VXz6J6W0; Thu, 5 Jan 2023 17:55:47 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 5 Jan 2023 09:58:03 +0000 Date: Thu, 5 Jan 2023 09:58:02 +0000 From: Jonathan Cameron To: Jiapeng Chong CC: , , , , Abaci Robot Subject: Re: [PATCH] iio: light: max44009: Remove the unused variable max44009_of_match Message-ID: <20230105095802.00002453@Huawei.com> In-Reply-To: <20230105095038.112564-1-jiapeng.chong@linux.alibaba.com> References: <20230105095038.112564-1-jiapeng.chong@linux.alibaba.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml500005.china.huawei.com (7.191.163.240) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 Thu, 5 Jan 2023 17:50:38 +0800 Jiapeng Chong wrote: > Variable max44009_of_match is not effectively used, so delete it. > > drivers/iio/light/max44009.c:545:34: warning: ‘max44009_of_match’ defined but not used. > > Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3632 > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong Thanks, but a better fix would be to set the of_device_id element of the driver structure to point to this (you'll need to move the of_device_id table up a few lines) Also, the MODULE_DEVICE_TABLE() macro is using this if you are building modules - so I'm fairly sure this is a false positive warning anyway. The resulting alias can be used as part of a module autoloading. Jonathan > --- > drivers/iio/light/max44009.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/drivers/iio/light/max44009.c b/drivers/iio/light/max44009.c > index 3dadace09fe2..2f80a654ad6a 100644 > --- a/drivers/iio/light/max44009.c > +++ b/drivers/iio/light/max44009.c > @@ -542,12 +542,6 @@ static struct i2c_driver max44009_driver = { > }; > module_i2c_driver(max44009_driver); > > -static const struct of_device_id max44009_of_match[] = { > - { .compatible = "maxim,max44009" }, > - { } > -}; > -MODULE_DEVICE_TABLE(of, max44009_of_match); > - > MODULE_AUTHOR("Robert Eshleman "); > MODULE_LICENSE("GPL v2"); > MODULE_DESCRIPTION("MAX44009 ambient light sensor driver");