From: Greg KH <gregkh@linuxfoundation.org> To: Serge Semin <fancer.lancer@gmail.com> Cc: srinivas.kandagatla@linaro.org, andrew@lunn.ch, robh+dt@kernel.org, mark.rutland@arm.com, Sergey.Semin@t-platforms.ru, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v4 1/2] eeprom: Add IDT 89HPESx EEPROM/CSR driver Date: Wed, 11 Jan 2017 09:21:19 +0100 [thread overview] Message-ID: <20170111082119.GA26387@kroah.com> (raw) In-Reply-To: <1481638971-6247-2-git-send-email-fancer.lancer@gmail.com> On Tue, Dec 13, 2016 at 05:22:50PM +0300, Serge Semin wrote: > +struct idt_89hpesx_dev { > + u32 eesize; > + bool eero; > + u8 eeaddr; > + > + u8 inieecmd; > + u8 inicsrcmd; > + u8 iniccode; > + > + atomic_t csr; Why is this an atomic_t and not just a "normal" u32 or u64? I don't see the need for an atomic variable at all here, do you? > + > + int (*smb_write)(struct idt_89hpesx_dev *, const struct idt_smb_seq *); > + int (*smb_read)(struct idt_89hpesx_dev *, struct idt_smb_seq *); > + struct mutex smb_mtx; > + > + struct i2c_client *client; > + > + struct bin_attribute *ee_file; > + struct dentry *csr_dir; > + struct dentry *csr_file; > +}; <snip> > + > +static int idt_create_dbgfs_files(struct idt_89hpesx_dev *pdev) > +{ > + struct device *dev = &pdev->client->dev; > + struct i2c_client *cli = pdev->client; > + char fname[CSRNAME_LEN]; > + > + /* Initialize basic value of CSR debugfs dentries */ > + pdev->csr_dir = NULL; > + pdev->csr_file = NULL; > + > + /* Return failure if root directory doesn't exist */ > + if (!csr_dbgdir) { > + dev_dbg(dev, "No Debugfs root directory"); > + return -EINVAL; > + } If debugfs is not enabled, don't error out, just keep going, it should never stop kernel code from running properly. Also, this test isn't really doing what you think it is doing... > + /* Create Debugfs directory for CSR file */ > + snprintf(fname, CSRNAME_LEN, "%d-%04hx", cli->adapter->nr, cli->addr); > + pdev->csr_dir = debugfs_create_dir(fname, csr_dbgdir); > + if (IS_ERR_OR_NULL(pdev->csr_dir)) { > + dev_err(dev, "Failed to create CSR node directory"); > + return -EINVAL; Again, don't do this, you really don't care if debugfs worked or not. > + } > + > + /* Create Debugfs file for CSR read/write operations */ > + pdev->csr_file = debugfs_create_file(cli->name, 0600, > + pdev->csr_dir, pdev, &csr_dbgfs_ops); > + if (IS_ERR_OR_NULL(pdev->csr_file)) { > + dev_err(dev, "Failed to create CSR dbgfs-node"); > + debugfs_remove_recursive(pdev->csr_dir); > + return -EINVAL; Same here, just create the file and move on. > + } > + > + dev_dbg(dev, "Debugfs-files created"); You do know about ftrace, right? Please remove all of these "trace-like" debugging lines, they aren't needed for anyone. thanks, greg k-h
WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org> To: Serge Semin <fancer.lancer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Cc: srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, andrew-g2DYL2Zd6BY@public.gmane.org, robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, Sergey.Semin-vHJ8rsvMqnUPfZBKTuL5GA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: Re: [PATCH v4 1/2] eeprom: Add IDT 89HPESx EEPROM/CSR driver Date: Wed, 11 Jan 2017 09:21:19 +0100 [thread overview] Message-ID: <20170111082119.GA26387@kroah.com> (raw) In-Reply-To: <1481638971-6247-2-git-send-email-fancer.lancer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> On Tue, Dec 13, 2016 at 05:22:50PM +0300, Serge Semin wrote: > +struct idt_89hpesx_dev { > + u32 eesize; > + bool eero; > + u8 eeaddr; > + > + u8 inieecmd; > + u8 inicsrcmd; > + u8 iniccode; > + > + atomic_t csr; Why is this an atomic_t and not just a "normal" u32 or u64? I don't see the need for an atomic variable at all here, do you? > + > + int (*smb_write)(struct idt_89hpesx_dev *, const struct idt_smb_seq *); > + int (*smb_read)(struct idt_89hpesx_dev *, struct idt_smb_seq *); > + struct mutex smb_mtx; > + > + struct i2c_client *client; > + > + struct bin_attribute *ee_file; > + struct dentry *csr_dir; > + struct dentry *csr_file; > +}; <snip> > + > +static int idt_create_dbgfs_files(struct idt_89hpesx_dev *pdev) > +{ > + struct device *dev = &pdev->client->dev; > + struct i2c_client *cli = pdev->client; > + char fname[CSRNAME_LEN]; > + > + /* Initialize basic value of CSR debugfs dentries */ > + pdev->csr_dir = NULL; > + pdev->csr_file = NULL; > + > + /* Return failure if root directory doesn't exist */ > + if (!csr_dbgdir) { > + dev_dbg(dev, "No Debugfs root directory"); > + return -EINVAL; > + } If debugfs is not enabled, don't error out, just keep going, it should never stop kernel code from running properly. Also, this test isn't really doing what you think it is doing... > + /* Create Debugfs directory for CSR file */ > + snprintf(fname, CSRNAME_LEN, "%d-%04hx", cli->adapter->nr, cli->addr); > + pdev->csr_dir = debugfs_create_dir(fname, csr_dbgdir); > + if (IS_ERR_OR_NULL(pdev->csr_dir)) { > + dev_err(dev, "Failed to create CSR node directory"); > + return -EINVAL; Again, don't do this, you really don't care if debugfs worked or not. > + } > + > + /* Create Debugfs file for CSR read/write operations */ > + pdev->csr_file = debugfs_create_file(cli->name, 0600, > + pdev->csr_dir, pdev, &csr_dbgfs_ops); > + if (IS_ERR_OR_NULL(pdev->csr_file)) { > + dev_err(dev, "Failed to create CSR dbgfs-node"); > + debugfs_remove_recursive(pdev->csr_dir); > + return -EINVAL; Same here, just create the file and move on. > + } > + > + dev_dbg(dev, "Debugfs-files created"); You do know about ftrace, right? Please remove all of these "trace-like" debugging lines, they aren't needed for anyone. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-01-11 8:21 UTC|newest] Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-10-02 23:13 [PATCH] Add IDT 89HPESx EEPROM/CSR driver Serge Semin 2016-10-30 13:53 ` Greg KH 2016-11-24 18:42 ` Serge Semin 2016-11-28 22:38 ` [PATCH v2 0/2] eeprom: " Serge Semin 2016-11-28 22:38 ` Serge Semin 2016-11-28 22:38 ` [PATCH v2 1/2] " Serge Semin 2016-11-28 22:38 ` Serge Semin 2016-11-29 19:34 ` Greg KH 2016-11-29 19:37 ` Greg KH 2016-11-29 19:37 ` Greg KH 2016-11-29 21:16 ` Serge Semin 2016-11-29 21:16 ` Serge Semin 2016-11-29 21:24 ` Greg KH 2016-11-29 21:45 ` Serge Semin 2016-11-28 22:38 ` [PATCH v2 2/2] eeprom: Add IDT 89HPESx driver bindings file Serge Semin 2016-11-28 22:38 ` Serge Semin 2016-11-29 19:34 ` Greg KH 2016-11-29 19:34 ` Greg KH 2016-11-29 21:15 ` Serge Semin 2016-11-29 21:15 ` Serge Semin 2016-12-05 14:46 ` Rob Herring 2016-12-05 15:25 ` Serge Semin 2016-12-05 15:25 ` Serge Semin 2016-12-05 17:27 ` Rob Herring 2016-12-05 17:27 ` Rob Herring 2016-12-05 19:04 ` Serge Semin 2016-12-05 19:04 ` Serge Semin 2016-12-09 1:57 ` Serge Semin 2016-12-09 1:57 ` Serge Semin 2016-12-12 23:04 ` Rob Herring 2016-12-12 23:04 ` Rob Herring 2016-12-13 14:08 ` Serge Semin 2016-12-13 14:08 ` Serge Semin 2016-11-29 22:27 ` [PATCH v3 0/2] eeprom: Add IDT 89HPESx EEPROM/CSR driver Serge Semin 2016-11-29 22:27 ` Serge Semin 2016-11-29 22:27 ` [PATCH v3 1/2] " Serge Semin 2016-11-29 22:27 ` [PATCH v3 2/2] eeprom: Add IDT 89HPESx driver dts-binding file Serge Semin 2016-11-29 22:27 ` Serge Semin 2016-12-13 14:22 ` [PATCH v4 0/2] eeprom: Add IDT 89HPESx EEPROM/CSR driver Serge Semin 2016-12-13 14:22 ` [PATCH v4 1/2] " Serge Semin 2017-01-11 8:21 ` Greg KH [this message] 2017-01-11 8:21 ` Greg KH 2017-01-12 22:54 ` Serge Semin 2017-01-12 22:54 ` Serge Semin 2017-01-13 7:22 ` Greg KH 2017-01-13 9:47 ` Serge Semin 2017-01-13 9:47 ` Serge Semin 2016-12-13 14:22 ` [PATCH v4 2/2] eeprom: Add IDT 89HPESx driver bindings file Serge Semin 2017-01-13 12:16 ` [PATCH v5 0/2] eeprom: Add IDT 89HPESx EEPROM/CSR driver Serge Semin 2017-01-13 12:16 ` [PATCH v5 1/2] " Serge Semin 2017-01-13 12:16 ` [PATCH v5 2/2] eeprom: Add IDT 89HPESx driver bindings file Serge Semin 2017-01-18 22:34 ` Rob Herring 2017-01-18 22:34 ` Rob Herring
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20170111082119.GA26387@kroah.com \ --to=gregkh@linuxfoundation.org \ --cc=Sergey.Semin@t-platforms.ru \ --cc=andrew@lunn.ch \ --cc=devicetree@vger.kernel.org \ --cc=fancer.lancer@gmail.com \ --cc=linux-kernel@vger.kernel.org \ --cc=mark.rutland@arm.com \ --cc=robh+dt@kernel.org \ --cc=srinivas.kandagatla@linaro.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.