linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Greg KH <greg@kroah.com>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Al Viro <viro@zeniv.linux.org.uk>, Joe Perches <joe@perches.com>
Subject: linux-next: manual merge of the staging tree with the vfs tree
Date: Wed, 10 Apr 2013 15:54:51 +1000	[thread overview]
Message-ID: <20130410155451.2792f82efeaf37b6e5889ea8@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 3322 bytes --]

Hi Greg,

Today's linux-next merge of the staging tree got a conflict in
drivers/staging/vt6655/device_main.c between commit f805442e130c
("vt6655: slightly clean reading config file") from the vfs tree and
commits 915006cddc79 ("staging:vt6655:device_main: Whitespace cleanups")
and 5e0cc8a231be ("staging: vt6655: Convert to kernel brace style") from
the staging tree.

I fixed it up (I think - see below) and can carry the fix as necessary
(no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/staging/vt6655/device_main.c
index a89ab9b,be4f6c2..0000000
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@@ -2933,39 -2723,61 +2724,39 @@@ static inline u32 ether_crc(int length
  
  //2008-8-4 <add> by chester
  static int Config_FileGetParameter(unsigned char *string,
- 		unsigned char *dest, unsigned char *source)
+ 				   unsigned char *dest, unsigned char *source)
  {
-   unsigned char buf1[100];
-   int source_len = strlen(source);
+ 	unsigned char buf1[100];
+ 	int source_len = strlen(source);
  
-     memset(buf1,0,100);
-     strcat(buf1, string);
-     strcat(buf1, "=");
-     source+=strlen(buf1);
+ 	memset(buf1, 0, 100);
+ 	strcat(buf1, string);
+ 	strcat(buf1, "=");
+ 	source += strlen(buf1);
  
-    memcpy(dest,source,source_len-strlen(buf1));
-  return true;
+ 	memcpy(dest, source, source_len - strlen(buf1));
+ 	return true;
  }
  
- int Config_FileOperation(PSDevice pDevice,bool fwrite,unsigned char *Parameter)
 -int Config_FileOperation(PSDevice pDevice, bool fwrite, unsigned char *Parameter) {
 -	unsigned char *config_path = CONFIG_PATH;
 -	unsigned char *buffer = NULL;
++int Config_FileOperation(PSDevice pDevice, bool fwrite, unsigned char *Parameter)
 +{
 +	unsigned char *buffer = kmalloc(1024, GFP_KERNEL);
  	unsigned char tmpbuffer[20];
 -	struct file   *filp = NULL;
 -	mm_segment_t old_fs = get_fs();
 -	//int oldfsuid=0,oldfsgid=0;
 +	struct file *file;
- 	int result=0;
+ 	int result = 0;
  
 -	set_fs(KERNEL_DS);
 -
 -	/* Can't do this anymore, so we rely on correct filesystem permissions:
 -	//Make sure a caller can read or write power as root
 -	oldfsuid=current->cred->fsuid;
 -	oldfsgid=current->cred->fsgid;
 -	current->cred->fsuid = 0;
 -	current->cred->fsgid = 0;
 -	*/
 -
 -	//open file
 -	filp = filp_open(config_path, O_RDWR, 0);
 -	if (IS_ERR(filp)) {
 -		printk("Config_FileOperation:open file fail?\n");
 -		result = -1;
 -		goto error2;
 -	}
 -
 -	if (!(filp->f_op) || !(filp->f_op->read) || !(filp->f_op->write)) {
 -		printk("file %s cann't readable or writable?\n", config_path);
 -		result = -1;
 -		goto error1;
 -	}
 -
 -	buffer = kmalloc(1024, GFP_KERNEL);
 -	if (buffer == NULL) {
 +	if (!buffer) {
  		printk("allocate mem for file fail?\n");
 -		result = -1;
 -		goto error1;
 +		return -1;
 +	}
 +	file = filp_open(CONFIG_PATH, O_RDONLY, 0);
 +	if (IS_ERR(file)) {
 +		kfree(buffer);
 +		printk("Config_FileOperation:open file fail?\n");
 +		return -1;
  	}
  
 -	if (filp->f_op->read(filp, buffer, 1024, &filp->f_pos) < 0) {
 +	if (kernel_read(file, 0, buffer, 1024) < 0) {
  		printk("read file error?\n");
  		result = -1;
  		goto error1;

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

             reply	other threads:[~2013-04-10  5:55 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10  5:54 Stephen Rothwell [this message]
2013-04-10 14:57 ` linux-next: manual merge of the staging tree with the vfs tree Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2020-03-12  5:16 Stephen Rothwell
2020-03-12  7:36 ` Greg KH
2018-10-09  4:59 Stephen Rothwell
2018-10-09  9:18 ` Greg KH
2018-03-13  4:22 Stephen Rothwell
2018-03-13  8:47 ` Greg KH
2017-12-04  2:06 Stephen Rothwell
2017-12-04  9:10 ` Greg KH
2017-12-04  1:58 Stephen Rothwell
2017-12-04  9:09 ` Greg KH
2017-11-09  4:01 Stephen Rothwell
2017-11-09  8:34 ` Greg KH
2016-12-12  4:21 Stephen Rothwell
2016-09-20  5:03 Stephen Rothwell
2016-09-20 11:14 ` Greg KH
2016-05-03  6:44 Stephen Rothwell
2016-05-03 18:19 ` Greg KH
2014-12-15  4:06 Stephen Rothwell
2014-11-27  9:11 Stephen Rothwell
2014-11-27  9:31 ` Stephen Rothwell
2014-11-27 16:20   ` Greg KH
2014-11-03  2:39 Stephen Rothwell
2014-11-03  2:31 Stephen Rothwell
2014-11-03  2:29 Stephen Rothwell
2014-11-03 23:57 ` Greg KH
2013-04-04  4:43 Stephen Rothwell
2013-04-05  1:44 ` Greg KH
2013-04-04  4:40 Stephen Rothwell
2013-04-05  1:45 ` Greg KH
2013-04-04  4:34 Stephen Rothwell
2013-04-05  1:45 ` Greg KH
2012-09-24  7:07 Stephen Rothwell
2012-09-25 22:38 ` Greg KH

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=20130410155451.2792f82efeaf37b6e5889ea8@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=greg@kroah.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).