Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1239740imm; Fri, 3 Aug 2018 22:35:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd7e9TZomP9j+WrzjwtMPmAR3CvJB3mebrwGZJ/qHsS/VCv8/QU+qm1P963yHTUtZwoPcml X-Received: by 2002:a63:555:: with SMTP id 82-v6mr6556264pgf.25.1533360904271; Fri, 03 Aug 2018 22:35:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533360904; cv=none; d=google.com; s=arc-20160816; b=lZw5hTKnePRVXPsApZbEk3A/Phtd68WFW/I28S3pfnZNf25VC0+rfDa/QVrYuXob4g gOOU6xLrHy3M40ikvS1soKQfWzEke28nCdxrItHIItWa/JB5I8o/DOiUJYguvXr8JjCD i0/a6NYTJThGasYn+6nSFa0EklfZd3AbRqvYHdi88pORMvwZcObOsjHM5y1DATxyL/uS ybKWcUubLbayk+Hs3gDduCoQfMSFbwFShnVzYP02c3XXEK47lePnlIEdYMYjJ/MRUpfl kae1wAHw+YvkrWXtQWQiniWsHE7v3YWki/msgc8vwWB/zcpDcdIHDhCKJl1FQhbT7Dcl vVIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=hm85MvCbz4wptIhmXB+otGYIJDghheeV8AlUWumubiQ=; b=VnGFHQk3OJbCrNlEhK4wcFGhNTKMR68HJ0HSg5uN2uQqioh+FYsbkUISqAwX40IOkc Qf3a0N6dsucOq/Hk4IvGUlxXwm+aT98xpDw+hTmq1GBIDt7BuTiy/cYMQZLNIdY84GNa 0Zup0ANGpUm7FY9LSsRO6NEzOfQUo4nMPKPZIlMZ3WkZqX4ftR4XvsDoqJIhsyi1In6e 8XDSnGsCjOIOlYwXjpjqvm9fNDm9qpQpPhhS5XBe7yxpibd4trMeJqSK/qgDnlVrTZbj oAHbrZmSvRnO4eHbz7/GlrR1++kDrZxQ8Cu3YA1agT8MDGDxTQgORvXWSxspkrTrEpN2 tClw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31-v6si6273515pla.129.2018.08.03.22.34.49; Fri, 03 Aug 2018 22:35:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727311AbeHDHd0 (ORCPT + 99 others); Sat, 4 Aug 2018 03:33:26 -0400 Received: from mail.bootlin.com ([62.4.15.54]:32947 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbeHDHdZ (ORCPT ); Sat, 4 Aug 2018 03:33:25 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 472622074F; Sat, 4 Aug 2018 07:33:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 81276206A8; Sat, 4 Aug 2018 07:33:58 +0200 (CEST) Date: Sat, 4 Aug 2018 07:33:58 +0200 From: Boris Brezillon To: Cc: "'Wolfram Sang'" , , "'Jonathan Corbet'" , , "'Greg Kroah-Hartman'" , "'Arnd Bergmann'" , "'Przemyslaw Sroka'" , "'Arkadiusz Golec'" , "'Alan Douglas'" , "'Bartosz Folta'" , "'Damian Kos'" , "'Alicja Jurasik-Urbaniak'" , "'Cyprian Wronka'" , "'Suresh Punnoose'" , "'Rafal Ciepiela'" , "'Thomas Petazzoni'" , "'Nishanth Menon'" , "'Rob Herring'" , "'Pawel Moll'" , "'Mark Rutland'" , "'Ian Campbell'" , "'Kumar Gala'" , , , "'Vitor Soares'" , "'Geert Uytterhoeven'" , "'Linus Walleij'" , "'Xiang Lin'" , , "'Sekhar Nori'" , "'Przemyslaw Gaj'" , "'Peter Rosin'" Subject: Re: [PATCH v6 01/10] i3c: Add core I3C infrastructure Message-ID: <20180804073358.7c5cf3a0@bbrezillon> In-Reply-To: <023901d42b72$5bc329d0$13497d70$@codeaurora.org> References: <20180719152930.3715-1-boris.brezillon@bootlin.com> <20180719152930.3715-2-boris.brezillon@bootlin.com> <023901d42b72$5bc329d0$13497d70$@codeaurora.org> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mike, On Fri, 3 Aug 2018 15:38:43 -0600 wrote: > > +static void > > +i3c_master_register_new_i3c_devs(struct i3c_master_controller *master) > > +{ > > + struct i3c_dev_desc *desc; > > + int ret; > > + > > + if (!master->init_done) > > + return; > > + > > + i3c_bus_for_each_i3cdev(master->bus, desc) { > > + if (desc->dev || !desc->info.dyn_addr) > > + continue; > > + > > + desc->dev = kzalloc(sizeof(*desc->dev), GFP_KERNEL); > > + if (!desc->dev) > > + continue; > > + > > + desc->dev->bus = master->bus; > > + desc->dev->desc = desc; > > + desc->dev->dev.parent = &master->bus->dev; > > + if (desc == master->this) > > + desc->dev->dev.type = &i3c_master_type; > > + else > > + desc->dev->dev.type = &i3c_device_type; > > + desc->dev->dev.bus = &i3c_bus_type; > > + desc->dev->dev.release = i3c_device_release; > > + dev_set_name(&desc->dev->dev, "%d-%llx", master->bus- > > >id, > > + desc->info.pid); > > + > > + if (desc->boardinfo) > > + desc->dev->dev.of_node = desc->boardinfo- > > >of_node; > > + > > + pr_info("%s:%i\n", __func__, __LINE__); > > + if (ret) > > + dev_err(master->parent, > > + "Failed to add I3C device (err = %d)\n", > ret); > > + } > > +} > > The compiler gives a warning that "ret" may be used uninitialized in the > above function, which is true since "ret" is never assigned a value. Also, > I wonder about the "pr_info" call here, should there be a more detailed > message here about the device being registered, other than the file name and > line number? Yes, kbuild already reported that problem. I messed up when selecting the lines to add to my commit and added this trace instead of ret = device_register(&desc->dev->dev); Will be fixed in v7. > > Otherwise, I have gone through the code in the process of writing the first > iteration of the Qualcomm I3C master driver, and overall the framework looks > good. Will update with any additional feedback I have. Thanks for looking at the framework code. Your driver is in my TODO list. Regards, Boris