From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10613C4332F for ; Thu, 20 Oct 2022 16:18:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229940AbiJTQSy (ORCPT ); Thu, 20 Oct 2022 12:18:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbiJTQSx (ORCPT ); Thu, 20 Oct 2022 12:18:53 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C0A210573; Thu, 20 Oct 2022 09:18:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666282732; x=1697818732; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=um53HRrJ8LVVo6L7ZwNauAEB6I/IHREg0YMMB7JEA+I=; b=QvKIbbS7gfP3bna+LX7vJVPRFVq/zJ8U3vJiS+nBCCHWzFI6ViESwztb E58+QNUSSX0iO+3MdxjEBpXLmnMq4/c3jCiAC/8+f9rh5YHeciVbFFqYW oDIV/aJzDyWf0694TlHu3KFOyIUwaxQmhMQT4yWlXBn3uXKatoA+DL51V cA3CPS3KQ5mK8OBOpHZgaM1Yl8GiZiWROPHv0aqyyAkeNP+bu1rvEOYF4 6bL3IUhZFpUcwnxa5e+ENHVjmET9MlBhJjpzNp0W7w7JFMnt1RpFTXOfE qVzyBFtqGK9FqPhCp4fcLTE8Vx8VSox5eTR8RnNjPHwxaVDmBm9fSOAgu A==; X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="304374540" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="304374540" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 09:18:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="772457862" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="772457862" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP; 20 Oct 2022 09:18:25 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1olYFT-00AdOh-2X; Thu, 20 Oct 2022 19:18:23 +0300 Date: Thu, 20 Oct 2022 19:18:23 +0300 From: Andy Shevchenko To: Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Mack , Haojian Zhuang , Robert Jarzmik Subject: Re: [PATCH v1 3/6] spi: pxa2xx: Remove no more needed PCI ID table Message-ID: References: <20221017171243.57078-1-andriy.shevchenko@linux.intel.com> <20221017171243.57078-3-andriy.shevchenko@linux.intel.com> 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 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org On Wed, Oct 19, 2022 at 04:50:38PM +0100, Mark Brown wrote: > On Wed, Oct 19, 2022 at 06:06:04PM +0300, Andy Shevchenko wrote: > > On Tue, Oct 18, 2022 at 12:42:03PM +0100, Mark Brown wrote: > > > > You should probably also restructure the code interpreting the device > > > IDs so that it's very clear that unknown values are handled well, this > > > would split things between multiple subsystems and right now the code is > > > a bit fragile. > > > I'm not sure how better to do this. Any example? > > For example a check that the ID is one we know about. IIRC that bit of > context looked like a tree of if statements with no particular > validation. But isn't it guaranteed to be handled by device core, i.e. we won't get driver even enumerated if ID is unknown to us. -- With Best Regards, Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1F3A6C4332F for ; Thu, 20 Oct 2022 16:19:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lV+rvvowOd5XKpd/QeDpuXM3ovTHa26jD4gJ0Zpfbwg=; b=3vTbC0yquIsAwk gwT322ynpssTR0j1sD/ZmtZthoK/6mcOpiUENZgfSYdZ+3N8vWVTQ5o1MowqYtqfJt3R49NbCJiuQ tyOBl1/pspQNDhthcYd6dOAfDdUwGOh3S4EioRpx/g0yvXJjWVUeCDbcK+swGZUSTcVT35SbSdZRb W0OO+krmAYzb6vHuii5DU+WrZQDaf/SBKPHb6+bQSy/mpjgFDO/8DzSjl5szlOB/SUZBf6V5UZFSv 8Odb9P3pFOaYwRBa1BLeaQ+zHg4I2mWlCqdUMN1IxTXLB0TFBuhLtA+MxJI+k/XV0zDFo3r9Dm2pQ 2COpFxpgGzOOPed90rpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1olYFj-000FTE-1v; Thu, 20 Oct 2022 16:18:39 +0000 Received: from mga06b.intel.com ([134.134.136.31] helo=mga06.intel.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1olYFd-000FPP-EX for linux-arm-kernel@lists.infradead.org; Thu, 20 Oct 2022 16:18:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666282713; x=1697818713; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=um53HRrJ8LVVo6L7ZwNauAEB6I/IHREg0YMMB7JEA+I=; b=HcWN6YDyleWosZndpOAmS4MF4UjDYBlsoPA1h8m+dpN6yqU1Bj43UxaR RuIDviueTW1DIHhmbAep6bLrrNxczugia/ibwoPZ4ERzvd4EdOE5dgDgq 1LkGq1zEcNK3UsEmML6CzGxB2I8n7i7TUov8+GcO9tMP4jU+gziqSus34 RiFKo/UkmZZsnuYq1nEbklIU0yLpmcWdOPFUvpGwtNRg9kR1F6peJr3e2 1Uu3O0zd3xtRbJWCu1esRhP3upJ72YUOfbbNVaRikTO4kJjBEXcEVFEsm sRsuHTc9bZWtVuAYsHu3MRvIxnr0afmtCm3VGh40fuaGZIsM82TJ5g5Yw A==; X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="368808027" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="368808027" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 09:18:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="772457862" X-IronPort-AV: E=Sophos;i="5.95,199,1661842800"; d="scan'208";a="772457862" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP; 20 Oct 2022 09:18:25 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1olYFT-00AdOh-2X; Thu, 20 Oct 2022 19:18:23 +0300 Date: Thu, 20 Oct 2022 19:18:23 +0300 From: Andy Shevchenko To: Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Mack , Haojian Zhuang , Robert Jarzmik Subject: Re: [PATCH v1 3/6] spi: pxa2xx: Remove no more needed PCI ID table Message-ID: References: <20221017171243.57078-1-andriy.shevchenko@linux.intel.com> <20221017171243.57078-3-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221020_091833_572538_A1621460 X-CRM114-Status: GOOD ( 20.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Oct 19, 2022 at 04:50:38PM +0100, Mark Brown wrote: > On Wed, Oct 19, 2022 at 06:06:04PM +0300, Andy Shevchenko wrote: > > On Tue, Oct 18, 2022 at 12:42:03PM +0100, Mark Brown wrote: > > > > You should probably also restructure the code interpreting the device > > > IDs so that it's very clear that unknown values are handled well, this > > > would split things between multiple subsystems and right now the code is > > > a bit fragile. > > > I'm not sure how better to do this. Any example? > > For example a check that the ID is one we know about. IIRC that bit of > context looked like a tree of if statements with no particular > validation. But isn't it guaranteed to be handled by device core, i.e. we won't get driver even enumerated if ID is unknown to us. -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel