Skip to contentSkip to conversation

x86/mm fixes

GIT PULL Linus Torvalds 4 participants 8 messages Mar 2, 2010 – Mar 5, 2010 1 message not in the archive Kbuild

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Review

Quoted 7 lines · H. Peter Anvin
(quoted diff) +4 -0
+		pfn = (res.start + PAGE_SIZE - 1) >> PAGE_SHIFT;
+		end_pfn = (res.end + 1) >> PAGE_SHIFT;
+		if (end_pfn > pfn)
+		    ret = (*func)(pfn, end_pfn - pfn, arg);
 		if (ret)
 			break;
 		res.start = res.end + 1;

What kind of messed-up indentation is that? We don't use 4-char indents.

Linus

#2 lore raw
Quoted 13 lines · Linus Torvalds

Review

Quoted 7 lines · H. Peter Anvin
(quoted diff) +4 -0
+		pfn = (res.start + PAGE_SIZE - 1) >> PAGE_SHIFT;
+		end_pfn = (res.end + 1) >> PAGE_SHIFT;
+		if (end_pfn > pfn)
+		    ret = (*func)(pfn, end_pfn - pfn, arg);
 		if (ret)
 			break;
 		res.start = res.end + 1;

What kind of messed-up indentation is that? We don't use 4-char indents.

Quoted 1 line

Linus

Sorry, you're right. I have to admit I didn't even see that aspect of the patch.

I'll add a reformatting patch and update the branch, if you want.

-hpa

#3 lore raw
In reply to Linus Torvalds
Quoted 13 lines · Linus Torvalds

Review

Quoted 7 lines · H. Peter Anvin
(quoted diff) +4 -0
+		pfn = (res.start + PAGE_SIZE - 1) >> PAGE_SHIFT;
+		end_pfn = (res.end + 1) >> PAGE_SHIFT;
+		if (end_pfn > pfn)
+		    ret = (*func)(pfn, end_pfn - pfn, arg);
 		if (ret)
 			break;
 		res.start = res.end + 1;

What kind of messed-up indentation is that? We don't use 4-char indents.

Branch updated with an indentation patch. Sorry about that.

-hpa

#4 lore raw
Quoted 15 lines · H. Peter Anvin
Quoted 13 lines · Linus Torvalds

Review

Quoted 7 lines · H. Peter Anvin
(quoted diff) +4 -0
+		pfn = (res.start + PAGE_SIZE - 1) >> PAGE_SHIFT;
+		end_pfn = (res.end + 1) >> PAGE_SHIFT;
+		if (end_pfn > pfn)
+		    ret = (*func)(pfn, end_pfn - pfn, arg);
 		if (ret)
 			break;
 		res.start = res.end + 1;

What kind of messed-up indentation is that? We don't use 4-char indents.

Quoted 1 line

Branch updated with an indentation patch. Sorry about that.

Sorry! Wondering I didn't do the indent with the vim '=='.

Anyway I just hacked /usr/share/quilt/refresh to automatically run the kernel style checker:

# wfg: check for kernel coding style
if [ -x scripts/checkpatch.pl ]; then
scripts/checkpatch.pl $patch_file
fi

Thanks,
Fengguang

#5 lore raw
Quoted 8 lines · Wu Fengguang

Anyway I just hacked /usr/share/quilt/refresh to automatically run the kernel style checker:

# wfg: check for kernel coding style
if [ -x scripts/checkpatch.pl ]; then
scripts/checkpatch.pl $patch_file
fi

It's probably sensible to check things, but do remember that some of the things checkpatch warns about are better left the way they are, rather than make the code uglier just to make checkpatch happy.

Linus

#6 lore raw
Quoted 7 lines · Linus Torvalds
Quoted 4 lines · Wu Fengguang

Anyway I just hacked /usr/share/quilt/refresh to automatically run the kernel style checker:

Quoted 8 lines
Quoted 4 lines

# wfg: check for kernel coding style
if [ -x scripts/checkpatch.pl ]; then
scripts/checkpatch.pl $patch_file
fi

It's probably sensible to check things, but do remember that some of the things checkpatch warns about are better left the way they are, rather than make the code uglier just to make checkpatch happy.

OK. Here is the simple patch for quilt. I guess it may be hardly acceptable for quilt upstream, so only intends to share it here.

Thanks,
Fengguang
---

usr/share/quilt/refresh renamed from usr/share/quilt/refresh.orig +6 -0
@@ -265,6 +265,12 @@ fi
 
 patch_file=$(patch_file_name $patch)
 
+# check for kernel coding style
+# Linus: please treat its warning as recommendation instead of requirement
+if [ -x scripts/checkpatch.pl ]; then
+	scripts/checkpatch.pl -q $patch_file
+fi
+
 trap "" SIGINT
 
 tmp_result=$(gen_tempfile) || die 1
#7 lore raw
Quoted 13 lines · Wu Fengguang
Quoted 12 lines · Linus Torvalds
Quoted 8 lines · Wu Fengguang

Anyway I just hacked /usr/share/quilt/refresh to automatically run the kernel style checker:

# wfg: check for kernel coding style
if [ -x scripts/checkpatch.pl ]; then
scripts/checkpatch.pl $patch_file
fi

Quoted 6 lines
Quoted 3 lines

It's probably sensible to check things, but do remember that some of the things checkpatch warns about are better left the way they are, rather than make the code uglier just to make checkpatch happy.

OK. Here is the simple patch for quilt. I guess it may be hardly acceptable for quilt upstream, so only intends to share it here.

I use the below, which allows me to specify what to run on refresh time.

The script I have it use looks like:

$ cat /usr/local/bin/fix-patch.sh
TMP=`tempfile -d /tmp`
awk -f /usr/local/bin/fix-patch.awk $1 > $TMP
if [ -x ./scripts/checkpatch.pl ]; then
        ./scripts/checkpatch.pl $TMP
fi
mv $TMP $1

and fix-patch.awk does things like sanitize mail headers and add Signed-off-by, lines.

---

usr/share/quilt/refresh renamed from usr/share/quilt/refresh~ +4 -0
@@ -278,6 +278,10 @@
 
 cat $tmp_patch >> $tmp_result
 
+if [ -n "$QUILT_REFRESH_EXT" ] ; then
+	$QUILT_REFRESH_EXT $tmp_result
+fi
+
 if [ -e $patch_file ] && \
    diff -q $patch_file $tmp_result > /dev/null
 then
#8 lore raw
Quoted 23 lines · Peter Zijlstra
Quoted 13 lines · Wu Fengguang
Quoted 12 lines · Linus Torvalds
Quoted 8 lines · Wu Fengguang

Anyway I just hacked /usr/share/quilt/refresh to automatically run the kernel style checker:

# wfg: check for kernel coding style
if [ -x scripts/checkpatch.pl ]; then
scripts/checkpatch.pl $patch_file
fi

Quoted 6 lines
Quoted 3 lines

It's probably sensible to check things, but do remember that some of the things checkpatch warns about are better left the way they are, rather than make the code uglier just to make checkpatch happy.

OK. Here is the simple patch for quilt. I guess it may be hardly acceptable for quilt upstream, so only intends to share it here.

I use the below, which allows me to specify what to run on refresh time.

Quoted 7 lines

The script I have it use looks like:

$ cat /usr/local/bin/fix-patch.sh
TMP=`tempfile -d /tmp`
awk -f /usr/local/bin/fix-patch.awk $1 > $TMP
if [ -x ./scripts/checkpatch.pl ]; then
        ./scripts/checkpatch.pl $TMP

FYI, I added "-q" to checkpatch.pl to shut it up when patch is OK.

Quoted 6 lines

fi
mv $TMP $1

and fix-patch.awk does things like sanitize mail headers and add Signed-off-by, lines.

Nice tool. Can you share fix-patch.awk? Thanks!

Regards,
Fengguang

Quoted 17 lines

---

usr/share/quilt/refresh renamed from usr/share/quilt/refresh~ +4 -0
@@ -278,6 +278,10 @@
 
 cat $tmp_patch >> $tmp_result
 
+if [ -n "$QUILT_REFRESH_EXT" ] ; then
+	$QUILT_REFRESH_EXT $tmp_result
+fi
+
 if [ -e $patch_file ] && \
    diff -q $patch_file $tmp_result > /dev/null
 then