All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: linux-next: build failure after merge of the scsi tree
Date: Thu, 29 Mar 2012 12:38:35 -0700	[thread overview]
Message-ID: <20120329193835.GA11820@kroah.com> (raw)
In-Reply-To: <20120327223939.GC3233@p183.telecom.by>

On Wed, Mar 28, 2012 at 01:39:39AM +0300, Alexey Dobriyan wrote:
> On Wed, Mar 28, 2012 at 01:35:10AM +0300, Alexey Dobriyan wrote:
> > On Tue, Mar 27, 2012 at 03:22:16PM -0700, Greg KH wrote:
> 
> > > > The amount of code once removed from staging prevented me from doing
> > > > any work on them.
> > > > 
> > > > Looking at staging ->read_proc users this is going to be a problem for
> > > > its removal. :-(
> > > 
> > > Why?
> > 
> > Because if staging does count, I can't remove the interface
> > without breaking allmodconfig and it would take forever to convert
> > staging stuff. I don't have energy to do it anymore.
> > Mainline still have several _hard_ ->read_proc conversions.
> > I've tried several times and failed.
> > 
> > If staging doesn't count, I will break allmodconfig and all those nasty
> > emails will show up anyway implying that staging does count.
> 
> It's comparable to what mainline has besides staging.
> I'm talking about this.
> 
> $ grep -e read_proc -w -n -r drivers/staging/
> drivers/staging/comedi/proc.c:92:               comedi_proc->read_proc = comedi_read;
> drivers/staging/rtl8192u/ieee80211/ieee80211_module.c:298:      e->read_proc = show_debug_level;
> drivers/staging/serial/68360serial.c:2428:      /* .read_proc = rs_360_read_proc, */
> drivers/staging/rtl8192e/rtllib_module.c:262:   e->read_proc = show_debug_level;

No you are not at all.  That's not the function to grep for, I have no
idea what you are trying to prove with this grep, but it is flat out
wrong.

Thanks to Gerard, I've looked at your patches, and it's obvious that you
didn't look to see what would needed to be done to convert the
drivers/staging/ drivers to your new interface.

In short, it's trivial, and it looks like you could take one of your
existing patches, rename the file, and it would apply cleanly to two of
the drivers, so you are already 2/3 done.

The other one is even simpler than that, I've included it below for your
perusal.

If you need me to, I can write these patches, but I can't build or test
them, as I do not see the proc_ops field in the scsi_host_template in
Linus's tree.

It's just part of changing apis, if you want to break them, then fix up
the existing users.  If you need help with existing users, just ask.

So feel free to take my patch below for your patch series, and if you
want me to fix up the other two, just ask.

thanks,

greg k-h
----------------------------

Subject: staging: rts_pstor: convert to scsi proc_ops

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

diff --git a/drivers/staging/rts_pstor/rtsx.c b/drivers/staging/rts_pstor/rtsx.c
index a7feb3e..114971c 100644
--- a/drivers/staging/rts_pstor/rtsx.c
+++ b/drivers/staging/rts_pstor/rtsx.c
@@ -24,6 +24,8 @@
 #include <linux/kthread.h>
 #include <linux/sched.h>
 #include <linux/workqueue.h>
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 
 #include "rtsx.h"
 #include "rtsx_chip.h"
@@ -128,16 +130,11 @@ static int slave_configure(struct scsi_device *sdev)
 /* we use this macro to help us write into the buffer */
 #undef SPRINTF
 #define SPRINTF(args...) \
-	do { if (pos < buffer+length) pos += sprintf(pos, ## args); } while (0)
+	seq_printf(m, ## args)
 
-static int proc_info(struct Scsi_Host *host, char *buffer,
-		char **start, off_t offset, int length, int inout)
+static int proc_show(struct seq_file *m, void *v)
 {
-	char *pos = buffer;
-
-	/* if someone is sending us data, just throw it away */
-	if (inout)
-		return length;
+	struct Scsi_Host *host = m->private;
 
 	/* print the controller name */
 	SPRINTF("   Host scsi%d: %s\n", host->host_no, CR_DRIVER_NAME);
@@ -146,20 +143,21 @@ static int proc_info(struct Scsi_Host *host, char *buffer,
 	SPRINTF("       Vendor: Realtek Corp.\n");
 	SPRINTF("      Product: PCIE Card Reader\n");
 	SPRINTF("      Version: %s\n", DRIVER_VERSION);
+	return 0;
+}
 
-	/*
-	 * Calculate start of next buffer, and return value.
-	 */
-	*start = buffer + offset;
-
-	if ((pos - buffer) < offset)
-		return 0;
-	else if ((pos - buffer - offset) < length)
-		return pos - buffer - offset;
-	else
-		return length;
+static int proc_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, proc_show, PDE(inode)->data);
 }
 
+static const struct file_operations proc_ops = {
+	.open		= proc_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
+
 /* queue a command */
 /* This is always called with scsi_lock(host) held */
 static int queuecommand_lck(struct scsi_cmnd *srb,
@@ -255,7 +253,7 @@ static struct scsi_host_template rtsx_host_template = {
 	/* basic userland interface stuff */
 	.name =				CR_DRIVER_NAME,
 	.proc_name =			CR_DRIVER_NAME,
-	.proc_info =			proc_info,
+	.proc_ops = 			&proc_ops,
 	.info =				host_info,
 
 	/* command interface -- queued only */

  parent reply	other threads:[~2012-03-29 19:38 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-26  1:17 linux-next: build failure after merge of the scsi tree Stephen Rothwell
2012-03-26  7:57 ` James Bottomley
2012-03-26 14:07   ` Greg KH
2012-03-27  7:29     ` James Bottomley
2012-03-27 22:17     ` Alexey Dobriyan
2012-03-27 22:22       ` Greg KH
2012-03-27 22:35         ` Alexey Dobriyan
2012-03-27 22:39           ` Alexey Dobriyan
2012-03-28 23:54             ` Greg KH
2012-03-29 19:38             ` Greg KH [this message]
2012-03-28 23:52           ` Greg KH
2012-03-29  7:32             ` Gerard Snitselaar
2012-03-29  8:25               ` Stephen Rothwell
2012-03-29  8:35                 ` James Bottomley
2012-03-29  9:03                 ` Gerard Snitselaar
2012-03-29 16:15                   ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2019-03-20  0:48 Stephen Rothwell
2017-08-28  8:02 Stephen Rothwell
2017-02-06  5:04 Stephen Rothwell
2017-02-13  0:32 ` Stephen Rothwell
2017-02-13 16:18   ` Jens Axboe
2016-12-23  0:45 Stephen Rothwell
2016-12-23  0:56 ` James Bottomley
     [not found]   ` <20161224123853.08284e8a@canb.auug.org.au>
2016-12-24 10:15     ` Ingo Molnar
2016-12-24 10:44       ` Stephen Rothwell
2016-12-24 11:46     ` Thomas Gleixner
2016-12-24 16:48       ` James Bottomley
2015-11-13  1:35 Stephen Rothwell
2015-11-13  8:32 ` Sreekanth Reddy
2015-06-02  8:06 Stephen Rothwell
2015-06-02 15:02 ` James Bottomley
2015-02-04  6:29 Stephen Rothwell
2015-02-04  6:47 ` Joe Perches
2015-02-04 15:26 ` James Bottomley
2014-11-10  6:15 Stephen Rothwell
2014-11-10  6:27 ` Anish Bhatt
2014-11-10 13:46   ` Christoph Hellwig
2014-11-10 15:21     ` James Bottomley
2014-11-10 15:48       ` Christoph Hellwig
2014-11-10 15:50         ` James Bottomley
2014-11-10 16:01           ` Christoph Hellwig
2014-11-04  4:43 Stephen Rothwell
2014-11-04  7:07 ` Hannes Reinecke
2014-11-05  4:48   ` Stephen Rothwell
2014-11-03  2:52 Stephen Rothwell
2014-11-03  7:51 ` Hannes Reinecke
2014-11-03 18:31   ` Christoph Hellwig
2014-09-26  8:34 Stephen Rothwell
2014-09-26  8:36 ` Christoph Hellwig
2014-09-26  9:57   ` James Bottomley
2014-09-26 12:43     ` Brian King
2013-01-12  2:23 wenxiong
2013-01-11  1:03 Stephen Rothwell
2013-01-11  7:34 ` James Bottomley
2013-01-11 15:27   ` Brian King
2013-01-11 15:37     ` James Bottomley
2013-01-11 16:05       ` Greg KH
2013-01-11 17:35         ` Brian King
2013-01-11 18:04           ` James Bottomley
2012-07-20  0:41 Stephen Rothwell
2012-07-20  8:50 ` James Bottomley
2012-03-23  2:00 Stephen Rothwell
2012-03-23  4:50 ` Benjamin Herrenschmidt
2012-03-23  8:14   ` James Bottomley
2012-03-23  8:53     ` Benjamin Herrenschmidt
2012-03-23  9:01       ` James Bottomley
2012-03-23 15:22         ` Jeff Garzik
2012-03-23 10:26   ` Alexey Dobriyan
2012-03-23 15:30     ` Jeff Garzik
2012-03-23  8:20 ` James Bottomley
2012-03-23  9:24   ` Stephen Rothwell
2011-12-15  1:58 Stephen Rothwell
2011-12-15  6:53 ` James Bottomley
2011-08-29  2:09 Stephen Rothwell
2011-08-29  7:17 ` James Bottomley
2011-08-29  8:07   ` Giridhar Malavali
2011-05-27  3:25 Stephen Rothwell
2011-05-27 13:47 ` James Bottomley
2010-10-26  0:19 Stephen Rothwell
2010-10-26 15:50 ` James Bottomley
2010-02-10  1:33 Stephen Rothwell
2010-02-10 22:16 ` James Bottomley
2010-02-10 23:11   ` Stephen Rothwell
2010-02-16  0:38   ` Stephen Rothwell

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=20120329193835.GA11820@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=adobriyan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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: link
Be 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.