All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org
Subject: Re: [PATCH] seq_file conversion: APM on mips
Date: Tue, 23 Jan 2007 14:36:14 +0000	[thread overview]
Message-ID: <20070123143614.GA6596@ucw.cz> (raw)
In-Reply-To: <20070115211413.GB5010@martell.zuzino.mipt.ru>

Hi!

> @@ -456,14 +456,26 @@ static int apm_get_info(char *buf, char 
>  	case 1: 	units = "sec";	break;
>  	}
>  
> -	ret = sprintf(buf, "%s 1.2 0x%02x 0x%02x 0x%02x 0x%02x %d%% %d %s\n",
> +	seq_printf(m, "%s 1.2 0x%02x 0x%02x 0x%02x 0x%02x %d%% %d %s\n",
>  		     driver_version, APM_32_BIT_SUPPORT,
>  		     info.ac_line_status, info.battery_status,
>  		     info.battery_flag, info.battery_life,
>  		     info.time, units);
> +	return 0;
> +}
>  
> - 	return ret;
> +static int proc_apm_open(struct inode *inode, struct file *file)
> +{
> +	return single_open(file, proc_apm_show, NULL);
>  }
> +
> +static const struct file_operations proc_apm_fops = {
> +	.owner		= THIS_MODULE,
> +	.open		= proc_apm_open,
> +	.read		= seq_read,
> +	.llseek		= seq_lseek,
> +	.release	= single_release,
> +};
>  #endif
>  
>  static int kapmd(void *arg)

Perhaps now is good time to make the code shared?

							Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2007-01-24 13:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-15 21:14 [PATCH] seq_file conversion: APM on mips Alexey Dobriyan
2007-01-23 14:36 ` Pavel Machek [this message]
2007-01-24 13:50   ` Alexey Dobriyan

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=20070123143614.GA6596@ucw.cz \
    --to=pavel@ucw.cz \
    --cc=adobriyan@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.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: 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.