id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
78e917d59c30c3d5a4cda7f47e0f40f1c98f9b02
Analyze and fix the following issue in the Linux kernel code: udf: fix sparse warning in namei.c
Problem Details: Let's use bsize instead. fs/udf/namei.c:960:12: warning: symbol 'elen' shadows an earlier one fs/udf/namei.c:937:15: originally declared here Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Cc: Jan Kara <jack@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Li...
```diff diff --git a/fs/udf/namei.c b/fs/udf/namei.c index ba5537d4bc15..2b34c8ca6c83 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -890,7 +890,7 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry, if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) { kernel_lb_addr eloc; - uint32_t elen; + ...
fa1ff1e02fee908dfdc3f92902d39acc38041e4c
Analyze and fix the following issue in the Linux kernel code: ext3: fix mount messages when quota disabled
Problem Details: When quota is disabled, we should not print 'journaled quota not supported' when user tried to mount non-journaled quota. Also fix typo in the message. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundat...
```diff diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 03d5c626c1cd..6303adfbdae4 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -1097,6 +1097,9 @@ clear_qf_name: case Opt_quota: case Opt_usrquota: case Opt_grpquota: + printk(KERN_ERR + "EXT3-fs: quota options not supported.\n"); + break; ...
2588ef83f7933d8ae42868d7bf68fc8a3001186b
Analyze and fix the following issue in the Linux kernel code: ext3: retry block allocation if new blocks are allocated from system zone
Problem Details: If the block allocator gets blocks out of system zone ext3 calls ext3_error. But if the file system is mounted with errors=continue retry block allocation. We need to mark the system zone blocks as in use to make sure retry don't pick them again System zone is the block range mapping block bitmap, in...
```diff diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c index dd4237e5e9ec..731fbc0f1291 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c @@ -164,10 +164,11 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group) block_group, le32_to_cpu(desc->bg_block_bitmap)); return NULL; } - if (!ex...
07c9938a4e2c92b796b163dc70e99d3d1870aaee
Analyze and fix the following issue in the Linux kernel code: ext3: fix hang on umount with quotas when journal is aborted
Problem Details: Call dquot_drop() from ext3_dquot_drop() even if we fail to start a transaction. Otherwise we never get to dropping references to quota structures from the inode and umount will hang indefinitely. Thanks to Payphone LIOU for spotting the problem. Signed-off-by: Jan Kara <jack@suse.cz> Cc: Payphone L...
```diff diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 770bbb4fa58c..03d5c626c1cd 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -2639,8 +2639,14 @@ static int ext3_dquot_drop(struct inode *inode) /* We may delete quota structure so we need to reserve enough blocks */ handle = ext3_journal_start(inod...
0b23076988b44b2c165e060248345de6f2337387
Analyze and fix the following issue in the Linux kernel code: ext3: fix update of mtime and ctime on rename
Problem Details: Make ext3 update mtime and ctime of the directory into which we move file even if the directory entry already exists. Signed-off-by: Jan Kara <jack@suse.cz> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: <linux-ext4@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Li...
```diff diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index ba55865caaaf..1a106572d63e 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c @@ -2323,6 +2323,8 @@ static int ext3_rename (struct inode * old_dir, struct dentry *old_dentry, EXT3_FEATURE_INCOMPAT_FILETYPE)) new_de->file_type = old_de->file_ty...
5b9a499d77e9dd39c9e6611ea10c56a31604f274
Analyze and fix the following issue in the Linux kernel code: jbd: fix possible journal overflow issues
Problem Details: There are several cases where the running transaction can get buffers added to its BJ_Metadata list which it never dirtied, which makes its t_nr_buffers counter end up larger than its t_outstanding_credits counter. This will cause issues when starting new transactions as while we are logging buffers w...
```diff diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c index d2f652e6e22e..cd931ef1f000 100644 --- a/fs/jbd/commit.c +++ b/fs/jbd/commit.c @@ -472,6 +472,9 @@ void journal_commit_transaction(journal_t *journal) */ commit_transaction->t_state = T_COMMIT; + J_ASSERT(commit_transaction->t_nr_buffers <= + commit_t...
5bc833feaa8b2236265764e7e81f44937be46eda
Analyze and fix the following issue in the Linux kernel code: jbd: fix the way the b_modified flag is cleared
Problem Details: Currently at the start of a journal commit we loop through all of the buffers on the committing transaction and clear the b_modified flag (the flag that is set when a transaction modifies the buffer) under the j_list_lock. The problem is that everywhere else this flag is modified only under the jbd lo...
```diff diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c index a38c7186c570..d2f652e6e22e 100644 --- a/fs/jbd/commit.c +++ b/fs/jbd/commit.c @@ -406,22 +406,6 @@ void journal_commit_transaction(journal_t *journal) jbd_debug (3, "JBD: commit phase 2\n"); - /* - * First, drop modified flag: all accesses to the buffe...
269b26191650be46ce6c91dec24cf20f59650529
Analyze and fix the following issue in the Linux kernel code: fs/ext3: use BUG_ON
Problem Details: if (...) BUG(); should be replaced with BUG_ON(...) when the test has no side-effects to allow a definition of BUG_ON that drops the code completely. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @ disable unlikely @ expression E,f; @@ ( ...
```diff diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c index da0cb2c0e437..dd4237e5e9ec 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c @@ -232,8 +232,7 @@ restart: prev = rsv; } printk("Window map complete.\n"); - if (bad) - BUG(); + BUG_ON(bad); } #define rsv_window_dump(root, verbose) \ __rsv_wind...
8b91582500ae750db22bd515379616e5e9ad06ab
Analyze and fix the following issue in the Linux kernel code: ext2: retry block allocation if new blocks are allocated from system zone
Problem Details: If the block allocator gets blocks out of system zone ext2 calls ext2_error. But if the file system is mounted with errors=continue retry block allocation. We need to mark the system zone blocks as in use to make sure retry don't pick them again System zone is the block range mapping block bitmap, in...
```diff diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index 25dec8633c94..10bb02c3f25c 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c @@ -149,11 +149,12 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group) block_group, le32_to_cpu(desc->bg_block_bitmap)); return NULL; } - if (!ex...
2c11619a590e13fecc801c9c50859cba29740f38
Analyze and fix the following issue in the Linux kernel code: fs/ext2: use BUG_ON
Problem Details: if (...) BUG(); should be replaced with BUG_ON(...) when the test has no side-effects to allow a definition of BUG_ON that drops the code completely. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @ disable unlikely @ expression E,f; @@ ( ...
```diff diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index e7b2bafa1dd9..c834f512dce5 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c @@ -245,8 +245,7 @@ restart: prev = rsv; } printk("Window map complete.\n"); - if (bad) - BUG(); + BUG_ON(bad); } #define rsv_window_dump(root, verbose) \ __rsv_wind...
1e3832b0b1518232f47d89bc9d1f68e151a749ff
Analyze and fix the following issue in the Linux kernel code: PNP: use dev_printk for quirk messages
Problem Details: Convert quirk printks to dev_printk(). [akpm@linux-foundation.org: fix warnings, improve output text] Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Adam Belay <ambx1@neo.rr.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation....
```diff diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index 1e8b1b4c09be..e4daf4635c48 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c @@ -49,8 +49,11 @@ static void quirk_awe32_resources(struct pnp_dev *dev) port2->max += 0x400; port3->min += 0x800; port3->max += 0x800; + dev_info(&de...
b8068162806266552933e395877452de4f2427e7
Analyze and fix the following issue in the Linux kernel code: PNP: simplify quirk debug output
Problem Details: print_fn_descriptor_symbol() prints the address if we don't have a symbol, so no need to print both. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index 37993206ae5d..1e8b1b4c09be 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c @@ -214,8 +214,8 @@ void pnp_fixup_device(struct pnp_dev *dev) quirk = pnp_fixups[i].quirk_function; #ifdef DEBUG - dev_dbg(&dev->dev, "calling quirk 0x...
0bc11fd446d2ca29459c3c8e04a6d36db9bbbea4
Analyze and fix the following issue in the Linux kernel code: PNP: skip dev->protocol NULL checks
Problem Details: Every PNP device should have a valid protocol pointer. If it doesn't, something's wrong and we should oops so we can find and fix the problem. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Adam Belay <ambx1@neo.rr.com> Cc: Adrian Bunk <bunk@kernel.org> Cc: Rene Herman <rene.herman@keyaccess...
```diff diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index 12a1645a2e43..e85cbf116db1 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c @@ -167,7 +167,7 @@ static int pnp_bus_suspend(struct device *dev, pm_message_t state) return error; } - if (pnp_dev->protocol && pnp_dev->protocol->susp...
62b0559aad5cba060568cb962e4bbb111ec73a14
Analyze and fix the following issue in the Linux kernel code: drivers/md: use time_before, time_before_eq, etc
Problem Details: The functions time_before, time_before_eq, time_after, and time_after_eq are more robust for comparing jiffies against other values. A simplified version of the semantic patch making this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @ change_compare_np @ expression E; @@ ( ...
```diff diff --git a/drivers/md/raid6algos.c b/drivers/md/raid6algos.c index 77a6e4bf503d..21987e3dbe6c 100644 --- a/drivers/md/raid6algos.c +++ b/drivers/md/raid6algos.c @@ -121,7 +121,8 @@ int __init raid6_select_algo(void) j0 = jiffies; while ( (j1 = jiffies) == j0 ) cpu_relax(); - while ( (jiffies-j1...
d7a420c9472a95c46600a0345434b7b166e0b9c7
Analyze and fix the following issue in the Linux kernel code: raid: remove leading TAB on printk messages
Problem Details: MD drivers use one printk() call to print 2 log messages and the second line may be prefixed by a TAB character. It may also output a trailing space before newline. klogd (I think) turns the TAB character into the 2 characters '^I' when logging to a file. This looks ugly. Instead of a leading TAB t...
```diff diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index 3f299d835a2b..42ee1a2dc144 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c @@ -244,7 +244,8 @@ static void multipath_error (mddev_t *mddev, mdk_rdev_t *rdev) conf->working_disks--; mddev->degraded++; printk(KERN_ALER...
8b3e6cdc53b7f29f7026955d6cb6902a49322a15
Analyze and fix the following issue in the Linux kernel code: md: introduce get_priority_stripe() to improve raid456 write performance
Problem Details: Improve write performance by preventing the delayed_list from dumping all its stripes onto the handle_list in one shot. Delayed stripes are now further delayed by being held on the 'hold_list'. The 'hold_list' is bypassed when: * a STRIPE_IO_STARTED stripe is found at the head of 'handle_list' *...
```diff diff --git a/Documentation/md.txt b/Documentation/md.txt index 396cdd982c26..a8b430627473 100644 --- a/Documentation/md.txt +++ b/Documentation/md.txt @@ -450,3 +450,9 @@ These currently include there are upper and lower limits (32768, 16). Default is 128. strip_cache_active (currently raid5 only) ...
9a7b2b0f36c40beeb252cb5ceff36bb295e88d97
Analyze and fix the following issue in the Linux kernel code: md: fix integer as NULL pointer warnings in md.c
Problem Details: drivers/md/md.c:734:16: warning: Using plain integer as NULL pointer drivers/md/md.c:1115:16: warning: Using plain integer as NULL pointer Add some braces to match the else-block as well. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Cc: Neil Brown <neilb@suse.de> Signed-off-by: Andrew M...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 5ebfb4d79901..87620b705bee 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -731,9 +731,9 @@ static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version else rdev->desc_nr = sb->this_disk.number; - if (refdev == 0) + if (!refd...
8224c3b166db81a8dbd128df455453897fe2b48b
Analyze and fix the following issue in the Linux kernel code: drivers/video/w100fb.c: avoid a couple of error-path NULL derefs
Problem Details: Fix a couple of error-patch oopses identified by Marcio Buss in http://bugzilla.kernel.org/show_bug.cgi?id=9567. Cc: Marcio Buss <marciobuss@gmail.com> Cc: Jeff Zhou <xinzhou.sjtu@gmail.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-...
```diff diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c index 003c49a490eb..30469bf906e5 100644 --- a/drivers/video/w100fb.c +++ b/drivers/video/w100fb.c @@ -765,8 +765,10 @@ int __init w100fb_probe(struct platform_device *pdev) printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id)...
0aa163418edfb96ca3b39133979d8e4352aaac3c
Analyze and fix the following issue in the Linux kernel code: fb: convert /proc/fb to seq_file interface
Problem Details: Note: looks like accesses to "registered_fb" are done without any exclusion so there're none in new proc code, too. This should be fixed in separate patch. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Si...
```diff diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 0c1461b26dd6..776f7fcd2fbf 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -26,6 +26,7 @@ #include <linux/init.h> #include <linux/linux_logo.h> #include <linux/proc_fs.h> +#include <linux/seq_file.h> #include <linux/console.h...
60c1645dfac320e992bb5635887b7698ae6606bc
Analyze and fix the following issue in the Linux kernel code: drivers/video/uvesafb.c: fix error-path memory leak
Problem Details: Fix bug identified by Daniel Marjamki: `m' is leaked on the error path. Addresses http://bugzilla.kernel.org/show_bug.cgi?id=10452 Cc: Daniel Marjamki <danielm77@spray.se> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: "Randy.Dunlap" <rdunlap@xenotime.net> Signed-off-by: Andrew Morton <akpm@linux-fou...
```diff diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index c4f4d7616317..cdbb56edb6cb 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -181,7 +181,8 @@ static int uvesafb_exec(struct uvesafb_ktask *task) /* If all slots are taken -- bail out. */ if (uvfb_tasks[seq]) { mutex...
963654a9c919d18f8b9137f8ffd9d2d30a139269
Analyze and fix the following issue in the Linux kernel code: fbdev: hecubafb bugfix
Problem Details: This patch is a bugfix for hecubafb_write which would return an incorrect error value for the bytecount from framebuffer writes. Signed-off-by: Jaya Kumar <jayakumar.lkml@gmail.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <a...
```diff diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c index 94e0df8a6f60..b77d033665da 100644 --- a/drivers/video/hecubafb.c +++ b/drivers/video/hecubafb.c @@ -270,41 +270,43 @@ static void hecubafb_imageblit(struct fb_info *info, static ssize_t hecubafb_write(struct fb_info *info, const char __user...
555514fabc1c24fac69ff46feac384180828182c
Analyze and fix the following issue in the Linux kernel code: fbdev: metronomefb bugfix
Problem Details: This patch is a bugfix for the use of cfb_* functions instead of sys_* functions. sys_* should be used with vmalloced framebuffers. the previous cfb_ use would not work for callers of imageblit/etc. Signed-off-by: Jaya Kumar <jayakumar.lkml@gmail.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: G...
```diff diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c index e9a89fd82757..5602f3e3f919 100644 --- a/drivers/video/metronomefb.c +++ b/drivers/video/metronomefb.c @@ -678,7 +678,7 @@ static void metronomefb_fillrect(struct fb_info *info, { struct metronomefb_par *par = info->par; - cfb_fill...
7d345b2253f92804948d66f4db17a49c1932b9a3
Analyze and fix the following issue in the Linux kernel code: fbdev: nv: fix sparse noise
Problem Details: Mostly signedness fixes. nv10_sim_state existence in both drivers suggests that one of them should be removed, but that's for later. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Antonino A. Daplas <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: ...
```diff diff --git a/drivers/video/nvidia/nv_hw.c b/drivers/video/nvidia/nv_hw.c index d1a10549f543..ed20a9871b33 100644 --- a/drivers/video/nvidia/nv_hw.c +++ b/drivers/video/nvidia/nv_hw.c @@ -129,7 +129,7 @@ typedef struct { int nvclk_khz; char mem_page_miss; char mem_latency; - int memory_type; + u32 memory_t...
5fb2d929a070fd31b8fb8f74cef8694a09853fdb
Analyze and fix the following issue in the Linux kernel code: atmel_lcdfb: adjust fifo size for at91sam9rl
Problem Details: AT91SAM9RL soc has a 2048 bytes deep FIFO, like AT91SAM9263. [bn@niasdigital.com: fix build breakage in atmel_lcdfb] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: Nicolas FERRE <nicolas.ferre@rfo.atmel.com> Cc: Andrew Victor <andrew@sanpeople.com...
```diff diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 5a31a7a40cd4..8ffdf3578768 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -31,7 +31,8 @@ #define ATMEL_LCDC_CVAL_DEFAULT 0xc8 #define ATMEL_LCDC_DMA_BURST_LEN 8 -#if defined(CONFIG_ARCH_AT91SAM9263) ...
20e061fb750d36ec0ffcb2e44ed7dafa9018223b
Analyze and fix the following issue in the Linux kernel code: fbdev: framebuffer_alloc() fixes
Problem Details: Correct the dev arg of framebuffer_alloc() in arkfb, s3fb and vt8623fb. Signed-off-by: Ondrej Zajicek <santiago@crfreenet.org> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c index 0f6e0043069d..5001bd4ef466 100644 --- a/drivers/video/arkfb.c +++ b/drivers/video/arkfb.c @@ -943,7 +943,7 @@ static int __devinit ark_pci_probe(struct pci_dev *dev, const struct pci_device_ } /* Allocate and fill driver data structure */ - ...
8f5af9de9cf3cbf51c5758a1d5ea266aea6fe175
Analyze and fix the following issue in the Linux kernel code: fbdev: vt8623fb: better resume from STR
Problem Details: After resume from STR, image is shifted by 8 pixels to the left. This patch fixes it. Signed-off-by: Ondrej Zajicek <santiago@crfreenet.org> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org...
```diff diff --git a/drivers/video/vt8623fb.c b/drivers/video/vt8623fb.c index f6895ef6bf59..0b9dd22f3ee6 100644 --- a/drivers/video/vt8623fb.c +++ b/drivers/video/vt8623fb.c @@ -436,6 +436,10 @@ static int vt8623fb_set_par(struct fb_info *info) svga_wcrt_multi(vt8623_offset_regs, offset_value); svga_wseq_multi(vt8...
bc3bf466e4a0a53d5c78561594c9cb4225bbb481
Analyze and fix the following issue in the Linux kernel code: radeonfb: drop redundant RTRACE macro
Problem Details: RTRACE() does exactly the same thing as the standard pr_debug() call, so just use the latter. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>...
```diff diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c index 10f32c83c96a..72cd0d2f14ec 100644 --- a/drivers/video/aty/radeon_base.c +++ b/drivers/video/aty/radeon_base.c @@ -1490,7 +1490,7 @@ static void radeon_calc_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs freq = rinf...
b0313f89672eddf0188dac96bb8f83135510a45c
Analyze and fix the following issue in the Linux kernel code: radeonfb: fix debug option
Problem Details: Fix CONFIG_FB_RADEON_DEBUG. DEBUG must be defined before including any kernel header, otherwise dev_dbg() resolves to a no-op. Also, when debugging is disabled, don't set DEBUG at all instead of setting it to 0, to comply with what the kernel headers expect. Signed-off-by: Jean Delvare <khali@linux-...
```diff diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c index 48e60cbc36c5..10f32c83c96a 100644 --- a/drivers/video/aty/radeon_base.c +++ b/drivers/video/aty/radeon_base.c @@ -52,6 +52,8 @@ #define RADEON_VERSION "0.2.0" +#include "radeonfb.h" + #include <linux/module.h> #include <...
af2afd247f0fae25d66f210fb800fe6a2958366e
Analyze and fix the following issue in the Linux kernel code: drivers/video/aty/aty128fb.c: fix incorrect usage of strncat in aty128_init()
Problem Details: Fix incorrect length for strncat by replacing it with strlcat Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index cbd3308b6690..27faffdee11b 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c @@ -1885,7 +1885,7 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i /* range check to make...
57a7a6db0eed2862072497116232f57a6843cadd
Analyze and fix the following issue in the Linux kernel code: fbmem: fix con2fbmap limit check
Problem Details: Fix limit check in FBIOPUT_CON2FBMAP ioctl. Signed-off-by: Peter Samuelson <peter@p12n.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 279c2dbef8f8..0c1461b26dd6 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -1057,7 +1057,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, case FBIOPUT_CON2FBMAP: if (copy_from_user(&con2fb, argp, sizeo...
b6f448e99ce7955b9707ed36a46cab2c6ddf7ddc
Analyze and fix the following issue in the Linux kernel code: PM/gxfb: add hook to PM console layer that allows disabling of suspend VT switch
Problem Details: Prior to suspend, we allocate and switch to a new VT; after suspend, we switch back to the original VT. This can be slow, and is completely unnecessary if the framebuffer we're using can restore video properly. This adds a hook that allows drivers to select whether or not to do this vt switch, and ch...
```diff diff --git a/Documentation/fb/gxfb.txt b/Documentation/fb/gxfb.txt index b56096142017..2f640903bbb2 100644 --- a/Documentation/fb/gxfb.txt +++ b/Documentation/fb/gxfb.txt @@ -45,7 +45,8 @@ Accepted options: mode_option - specify the video mode. Of the form <x>x<y>[-<bpp>][@<refresh>] vram - size of vid...
f0a0c1f20f837221c0d990a54ae5426acf039036
Analyze and fix the following issue in the Linux kernel code: gxfb: set the right registers to tweak the sync polarity
Problem Details: While running in flatpanel mode it is important to change the FP sync bits (VG register 0x408) rather then the CRT sync bits (VG register 0x008). This patch keeps the CRT sync bits at default when a flatpanel exists. Note that this also fixes inverted logic; we want CRT_VSYNC_POL to be set (ie, vsync...
```diff diff --git a/drivers/video/geode/video_gx.c b/drivers/video/geode/video_gx.c index d0885370675d..06245a8400c7 100644 --- a/drivers/video/geode/video_gx.c +++ b/drivers/video/geode/video_gx.c @@ -208,7 +208,7 @@ gx_configure_tft(struct fb_info *info) fp = 0x0F100000; - /* Add sync polarity */ + /* Configur...
22af89aa0c0b4012a7431114a340efd3665a7617
Analyze and fix the following issue in the Linux kernel code: fbcon: replace mono_col macro with static inline
Problem Details: Use __u32 for max_len to match the declaration of length in the struct fb_bitfield. Suppresses sparse shadowed variable warnings from the nested max() macros: drivers/video/console/fbcon.h:130:8: warning: symbol '_x' shadows an earlier one drivers/video/console/fbcon.h:130:8: originally declared here ...
```diff diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h index 3706307e70ed..0135e0395456 100644 --- a/drivers/video/console/fbcon.h +++ b/drivers/video/console/fbcon.h @@ -104,10 +104,14 @@ struct fbcon_ops { #define attr_blink(s) \ ((s) & 0x8000) -#define mono_col(info) \ - (~(0x...
2ae09f0da1cd0c8c646edea2e68356e76789461c
Analyze and fix the following issue in the Linux kernel code: pm2fb: correct error values returned from probe function
Problem Details: Fix error values returned in some code branches in the pm2fb_probe() function. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c index 30181b593829..82aa8242f441 100644 --- a/drivers/video/pm2fb.c +++ b/drivers/video/pm2fb.c @@ -1687,10 +1687,12 @@ static int __devinit pm2fb_probe(struct pci_dev *pdev, if (!err || err == 4) info->var = pm2fb_var; - if (fb_alloc_cmap(&info-...
169b6a7a6e91e1ea32136681b475cbaf2074bf35
Analyze and fix the following issue in the Linux kernel code: gpiochip_reserve()
Problem Details: Add a new function gpiochip_reserve() to reserve ranges of gpios that platform code has pre-allocated. That is, this marks gpio numbers which will be claimed by drivers that haven't yet been loaded, and thus are not available for dynamic gpio number allocation. [akpm@linux-foundation.org: remove unne...
```diff diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 2ba6127c4fae..24c62b848bf9 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -43,6 +43,7 @@ struct gpio_desc { /* flag symbols are bit numbers */ #define FLAG_REQUESTED 0 #define FLAG_IS_OUT 1 +#define FLAG_RESERVED 2 #if...
c24e9b3fa3fdfca3834eba0bb217c8c197a43b7e
Analyze and fix the following issue in the Linux kernel code: capifs: fix memory leak on remount
Problem Details: capifs_remount may reach 'return' statement without freeing of memory allocated by kstrdup call Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Cc: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/isdn/capi/capifs.c b/drivers/isdn/capi/capifs.c index eafe0e9daa7c..550e80f390a6 100644 --- a/drivers/isdn/capi/capifs.c +++ b/drivers/isdn/capi/capifs.c @@ -69,6 +69,7 @@ static int capifs_remount(struct super_block *s, int *flags, char *data) } else if (sscanf(this_char, "mode=%o%c", &...
f3429545d03a553c6a3e9fcf60ddea31819848ad
Analyze and fix the following issue in the Linux kernel code: isdn: fix obvious cut-and-paste error in st5481_usb.c
Problem Details: Fix a rather obvious cut-and-paste error, where earlier code for the controller URB got somehow mixed in with code for the interrupt URB. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Cc: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Lin...
```diff diff --git a/drivers/isdn/hisax/st5481_usb.c b/drivers/isdn/hisax/st5481_usb.c index 4ada66b8b679..427a8b0520f5 100644 --- a/drivers/isdn/hisax/st5481_usb.c +++ b/drivers/isdn/hisax/st5481_usb.c @@ -342,7 +342,7 @@ void st5481_release_usb(struct st5481_adapter *adapter) usb_kill_urb(intr->urb); kfree(intr->...
dd58c0dd30ac761837b1d0d8cc434c7ec7b2df68
Analyze and fix the following issue in the Linux kernel code: eicon: fix sparse integer as NULL pointer warnings
Problem Details: drivers/isdn/hardware/eicon/message.c:745:47: warning: Using plain integer as NULL pointer drivers/isdn/hardware/eicon/message.c:761:45: warning: Using plain integer as NULL pointer drivers/isdn/hardware/eicon/message.c:9122:16: warning: Using plain integer as NULL pointer drivers/isdn/hardware/eicon/m...
```diff diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c index 6d39f9360766..5fcbdccd7a53 100644 --- a/drivers/isdn/hardware/eicon/divasmain.c +++ b/drivers/isdn/hardware/eicon/divasmain.c @@ -393,7 +393,7 @@ void diva_free_dma_map(void *hdev, struct _diva_dma_map_entry *pm...
8e44b29da5300f4698c41b5fd2d1ce52c28e2148
Analyze and fix the following issue in the Linux kernel code: avm: fix sparse warning using integer as NULL pointer
Problem Details: drivers/isdn/hardware/avm/b1isa.c:206:37: warning: Using plain integer as NULL pointer drivers/isdn/hardware/avm/b1isa.c:208:33: warning: Using plain integer as NULL pointer drivers/isdn/hardware/avm/b1.c:664:42: warning: Using plain integer as NULL pointer drivers/isdn/hardware/avm/b1.c:666:44: warnin...
```diff diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c index 4484a6417235..abf05ec31760 100644 --- a/drivers/isdn/hardware/avm/b1.c +++ b/drivers/isdn/hardware/avm/b1.c @@ -661,11 +661,11 @@ int b1ctl_read_proc(char *page, char **start, off_t off, len += sprintf(page+len, "%-16s %s\n", "...
2f9e9b6db31d96fe4e8b519b8aab1ba172dd3ddf
Analyze and fix the following issue in the Linux kernel code: capi: fix sparse warnings using integer as NULL pointer
Problem Details: drivers/isdn/capi/kcapi.c:829:30: warning: Using plain integer as NULL pointer drivers/isdn/capi/kcapi.c:838:27: warning: Using plain integer as NULL pointer drivers/isdn/capi/kcapi.c:954:17: warning: Using plain integer as NULL pointer drivers/isdn/capi/kcapi.c:1007:37: warning: Using plain integer as...
```diff diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index 23ae66c76d47..24c6b7ca62be 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c @@ -350,7 +350,7 @@ static void capincci_free(struct capidev *cdev, u32 ncci) if (ncci == 0xffffffff || np->ncci == ncci) { *pp = (*pp)->n...
50f8c370e77befe9121720bd7bdada2ac0d13915
Analyze and fix the following issue in the Linux kernel code: quota: convert stub functions from macros into inlines
Problem Details: Fixes things like this: fs/super.c: In function `deactivate_super': fs/super.c:182: warning: statement with no effect fs/super.c: In function `do_remount_sb': fs/super.c:644: warning: statement with no effect Cc: Jan Kara <jack@ucw.cz> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morto...
```diff diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index c97c8f3fa6ee..f86702053853 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h @@ -207,14 +207,43 @@ static inline int DQUOT_ON_REMOUNT(struct super_block *sb) */ #define sb_dquot_ops (NULL) #define sb_quotactl_ops ...
6f28e08794749f3431e89302728e612343d9d9e4
Analyze and fix the following issue in the Linux kernel code: quota: ext4: make ext4 handle quotaon on remount
Problem Details: Update ext4 to handle quotaon on remount RW. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 13383ba18f1d..c81a8e759bad 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -813,7 +813,8 @@ static int ext4_acquire_dquot(struct dquot *dquot); static int ext4_release_dquot(struct dquot *dquot); static int ext4_mark_dquot_dirty(struct dquot *dquot); ...
2fd83a4f3cd5a725168e3a269746dfce2adfa56a
Analyze and fix the following issue in the Linux kernel code: quota: ext3: make ext3 handle quotaon on remount
Problem Details: Update ext3 handle quotaon on remount RW. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/fs/ext3/super.c b/fs/ext3/super.c index ad5360664082..883ff965d984 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -685,7 +685,8 @@ static int ext3_acquire_dquot(struct dquot *dquot); static int ext3_release_dquot(struct dquot *dquot); static int ext3_mark_dquot_dirty(struct dquot *dquot); ...
03f6e92bdd467aed9d7571a571868563ae6ad288
Analyze and fix the following issue in the Linux kernel code: quota: various style cleanups
Problem Details: Cleanups in quota code: Change __inline__ to inline. Change some macros to inline functions. Remove vfs_quota_off_mount() macro. DQUOT_OFF() should be (0) is CONFIG_QUOTA is disabled. Move declaration of mark_dquot_dirty and dirty_dquot from quota.h to dquot.c [akpm@linux-foundation.org: cod...
```diff diff --git a/fs/dquot.c b/fs/dquot.c index 24eef582d2a0..fc26d1097d3c 100644 --- a/fs/dquot.c +++ b/fs/dquot.c @@ -289,7 +289,15 @@ static void wait_on_dquot(struct dquot *dquot) mutex_unlock(&dquot->dq_lock); } -#define mark_dquot_dirty(dquot) ((dquot)->dq_sb->dq_op->mark_dirty(dquot)) +static inline int ...
3d8d996e0ca5b4093203d3f050b0f70b5c949ae8
Analyze and fix the following issue in the Linux kernel code: kprobes: prevent probing of preempt_schedule()
Problem Details: Prohibit users from probing preempt_schedule(). One way of prohibiting the user from probing functions is by marking such functions with __kprobes. But this method doesn't work for those functions, which are already marked to different section like preempt_schedule() (belongs to __sched section). So...
```diff diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 0f28486f6360..cd507ab4fed7 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h @@ -173,6 +173,13 @@ struct kretprobe_blackpoint { const char *name; void *addr; }; + +struct kprobe_blackpoint { + const char *name; + unsigned...
0341a4d0fdd2a0a3d9e2bb3a9afef9f8292c8502
Analyze and fix the following issue in the Linux kernel code: VT notifier extension for accessibility
Problem Details: Some accessibility modules need to be able to catch the output on the console before the VT interpretation, and possibly swallow it. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Si...
```diff diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 9b58b894f823..df4c3ead9e2b 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -2054,6 +2054,7 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co unsigned long draw_from = 0, draw_to = 0; struct vc_data *vc; un...
cf43369d55a30a0d8f9ef4700c798c72dbd3afb7
Analyze and fix the following issue in the Linux kernel code: spi: pxa2xx_spi "sparse" fixes
Problem Details: Various cleanups to pxa2xx_spi suggested by "sparse": make sure that register addresess are "void __iomem *", and make a few functions properly static. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Ned Forrester <nforrester@whoi.edu> Cc: Stephen Street <stephen@streetfiresound.co...
```diff diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c index 147e26a78d64..654bb58be630 100644 --- a/drivers/spi/pxa2xx_spi.c +++ b/drivers/spi/pxa2xx_spi.c @@ -67,8 +67,11 @@ MODULE_ALIAS("platform:pxa2xx-spi"); | SSCR1_SPH | SSCR1_SPO | SSCR1_LBM) #define DEFINE_SSP_REG(reg, off) \ -static i...
608dfddd845da5ab6accef70154c8910529699f7
Analyze and fix the following issue in the Linux kernel code: oprofile: change cpu_buffer from array to per_cpu variable
Problem Details: Change cpu_buffer from array to per_cpu variable in oprofile functions. [akpm@linux-foundation.org: coding-style fixes] Cc: Philippe Elie <phil.el@wanadoo.fr> Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@li...
```diff diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c index b07ba2a14119..9304c4555079 100644 --- a/drivers/oprofile/buffer_sync.c +++ b/drivers/oprofile/buffer_sync.c @@ -491,7 +491,7 @@ typedef enum { */ void sync_buffer(int cpu) { - struct oprofile_cpu_buffer * cpu_buf = &cpu_buffe...
d83fd8a26769c75d51a6b05d8dcb3e36302dd8ba
Analyze and fix the following issue in the Linux kernel code: drivers/acpi/thermal.c: fix build with CONFIG_DMI=n
Problem Details: drivers/acpi/thermal.c: In function 'acpi_thermal_init': drivers/acpi/thermal.c:1794: error: 'thermal_dmi_table' undeclared (first use in this function) drivers/acpi/thermal.c:1794: error: (Each undeclared identifier is reported only once drivers/acpi/thermal.c:1794: error: for each function it appears...
```diff diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 1bcecc7dd2ca..766bd25d3376 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -1710,7 +1710,6 @@ static int acpi_thermal_resume(struct acpi_device *device) return AE_OK; } -#ifdef CONFIG_DMI static int thermal_act(const st...
6e10efefaae45989f2f143bacfef75af55068378
Analyze and fix the following issue in the Linux kernel code: atmel_serial: remove duplicated macro definition
Problem Details: After commit 39d4c922b596633da86878b1a5cc881785b8e5fa (atmel_serial: fix uart/console concurrent access) the UART_GET_TCR macro got redefined. This patch removes the duplicated definition. Signed-off-by: michael trimarchi <trimarchimichael@evidence.eu.com> Acked-by: Haavard Skinnemoen <hskinnemoen@atm...
```diff diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index 55492fa095a2..c065a704a93a 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c @@ -96,7 +96,6 @@ /* PDC registers */ #define UART_PUT_PTCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_PTCR) -#...
01c194d9278efc15d4785ff205643e9c0bdcef53
Analyze and fix the following issue in the Linux kernel code: serial 8250: tighten test for using backup timer
Problem Details: Thomas Koeller had reported an issue where a device that had been making use of the UART_BUG_TXEN code in the 8250 driver was mistakenly being caught by the backup timer test, causing the device to work improperly. To fix this, tighten the test requirements to enable the backup timer workaround. The ...
```diff diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 6d0ce64163e5..ea41f2626458 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -1868,6 +1868,7 @@ static int serial8250_startup(struct uart_port *port) } if (is_real_interrupt(up->port.irq)) { + unsigned char iir1; /* *...
eb424fd21c0931e998156225f2a0910167c3e16c
Analyze and fix the following issue in the Linux kernel code: uart_get_baud_rate: stop mangling termios
Problem Details: Russell King noticed this one: We have to avoid replacing B0 when we pick a baud rate for a "hung up" port. Ugly but the proper fix is in the tty layer and means changing the tty<->serial interfaces so we will defer that for now. [akpm@linux-foundation.org: fix uninitialised var] Signed-off-by: Alan ...
```diff diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index a9ca03ead3e5..977ce820ce30 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -329,13 +329,15 @@ EXPORT_SYMBOL(uart_update_timeout); * If it's still invalid, we try 9600 baud. * * Update the @termio...
e991a2bd4fa0b2f475b67dfe8f33e8ecbdcbb40b
Analyze and fix the following issue in the Linux kernel code: Fix tty speed handling on 8250
Problem Details: We try and write the correct speed back but the serial midlayer already mangles the speed on us and that means if we request B0 we report back B9600 when we should not. For now we'll hack around this in the drivers and serial code, pending a better long term solution. Signed-off-by: Alan Cox <alan@re...
```diff diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 96a585e1cee8..6d0ce64163e5 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -2228,7 +2228,9 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios, } serial8250_set_mctrl(&up->port, up->port.mctrl); spin_...
ce9f9f73af0338a680d66288cbf0efe4b900e78b
Analyze and fix the following issue in the Linux kernel code: char: make functions static in synclinkmp.c
Problem Details: All were forward declared with static. Fixes sparse warnings: drivers/char/synclinkmp.c:1476:5: warning: symbol 'read_proc' was not declared. Should it be static? drivers/char/synclinkmp.c:2027:5: warning: symbol 'bh_action' was not declared. Should it be static? drivers/char/synclinkmp.c:2058:6: warn...
```diff diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index 66e8082aff7b..e98c3e6f8216 100644 --- a/drivers/char/synclinkmp.c +++ b/drivers/char/synclinkmp.c @@ -1473,7 +1473,7 @@ static inline int line_info(char *buf, SLMP_INFO *info) /* Called to print information about devices */ -int read_...
7a63ce5a1f2fde5ae737f059e2714e441447120c
Analyze and fix the following issue in the Linux kernel code: serial: silence section mismatch warnings in 8250_pci
Problem Details: Fix following warnings: WARNING: drivers/serial/built-in.o(.data+0x5b8): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:pci_ite887x_exit() WARNING: drivers/serial/built-in.o(.data+0x5e0): Section mismatch in reference from the variable pci_serial_quirks ...
```diff diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c index f97224ce59da..6e57382b9137 100644 --- a/drivers/serial/8250_pci.c +++ b/drivers/serial/8250_pci.c @@ -775,7 +775,7 @@ pci_default_setup(struct serial_private *priv, struct pciserial_board *board, * This list is ordered alphabetically by ...
eee3754f5e45bd27e001ea41823bdbcdd0d192d4
Analyze and fix the following issue in the Linux kernel code: ncpfs: fix sparse warning in ncpsign_kernel.c
Problem Details: We're casting anyway, might as well cast to the correct sign. Specific to i386 (ifdef __i386__) fs/ncpfs/ncpsign_kernel.c:58:23: warning: incorrect type in initializer (different signedness) fs/ncpfs/ncpsign_kernel.c:58:23: expected unsigned int *data2 fs/ncpfs/ncpsign_kernel.c:58:23: got int *<...
```diff diff --git a/fs/ncpfs/ncpsign_kernel.c b/fs/ncpfs/ncpsign_kernel.c index 749a18d33599..7c0b5c21e6cf 100644 --- a/fs/ncpfs/ncpsign_kernel.c +++ b/fs/ncpfs/ncpsign_kernel.c @@ -55,7 +55,7 @@ static void nwsign(char *r_data1, char *r_data2, char *outdata) { unsigned int w0,w1,w2,w3; static int rbit[4]={0, 2, 1...
305787e44ebc21d87ab4d4949da5b97d4252aa9b
Analyze and fix the following issue in the Linux kernel code: ncpfs: fix sparse warnings in ioctl.c
Problem Details: In both cases, these inode variables arebeing used to test the server's root inode against NULL. Change them to s_inode. fs/ncpfs/ioctl.c:391:18: warning: symbol 'inode' shadows an earlier one fs/ncpfs/ioctl.c:264:28: originally declared here fs/ncpfs/ioctl.c:441:17: warning: symbol 'inode' shadows an...
```diff diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c index ad8f167e54bc..3a97c95e1ca2 100644 --- a/fs/ncpfs/ioctl.c +++ b/fs/ncpfs/ioctl.c @@ -389,11 +389,11 @@ static int __ncp_ioctl(struct inode *inode, struct file *filp, struct dentry* dentry = inode->i_sb->s_root; if (dentry) { - struct inode* i...
ed6b9b97f42c091630335bfb71a2931e6f86388b
Analyze and fix the following issue in the Linux kernel code: alpha: teach the compiler that BUG doesn't return
Problem Details: Fix things like this: security/selinux/netnode.c: In function 'sel_netnode_find': security/selinux/netnode.c:126: warning: 'idx' may be used uninitialized in this function security/selinux/netnode.c: In function 'sel_netnode_sid': security/selinux/netnode.c:225: warning: 'ret' may be used uninitialize...
```diff diff --git a/include/asm-alpha/bug.h b/include/asm-alpha/bug.h index 39a3e2a5017d..695a5ee4b5d3 100644 --- a/include/asm-alpha/bug.h +++ b/include/asm-alpha/bug.h @@ -1,14 +1,24 @@ #ifndef _ALPHA_BUG_H #define _ALPHA_BUG_H +#include <linux/linkage.h> + #ifdef CONFIG_BUG #include <asm/pal.h> /* ??? Woul...
037f436f525dac36c9f5fd5c5054518a63debb3e
Analyze and fix the following issue in the Linux kernel code: arch/alpha/kernel/traps.c: use time_* macros
Problem Details: The functions time_before, time_before_eq, time_after, and time_after_eq are more robust for comparing jiffies against other values. So implement usage of the time_after() macro, defined in linux/jiffies.h, which deals with wrapping correctly [akpm@linux-foundation.org: fix warning] Signed-off-by: S....
```diff diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c index 2dc7f9fed213..dc57790250d2 100644 --- a/arch/alpha/kernel/traps.c +++ b/arch/alpha/kernel/traps.c @@ -8,6 +8,7 @@ * This file initializes the trap entry points */ +#include <linux/jiffies.h> #include <linux/mm.h> #include <linux/sc...
c60264c494a119cd3a716a22edc0137b11de6d1e
Analyze and fix the following issue in the Linux kernel code: smack: fix integer as NULL pointer warning in smack_lsm.c
Problem Details: security/smack/smack_lsm.c:1257:16: warning: Using plain integer as NULL pointer Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Acked-by: Casey Schaufler <casey@schaufler-ca.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundati...
```diff diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 4215971434e6..430f97b9d04a 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -1242,7 +1242,7 @@ static void smack_set_catset(char *catset, struct netlbl_lsm_secattr *sap) int rc; int byte; - if (catset == ...
3898b1b4ebff8dcfbcf1807e0661585e06c9a91c
Analyze and fix the following issue in the Linux kernel code: capabilities: implement per-process securebits
Problem Details: Filesystem capability support makes it possible to do away with (set)uid-0 based privilege and use capabilities instead. That is, with filesystem support for capabilities but without this present patch, it is (conceptually) possible to manage a system with capabilities alone and never need to obtain p...
```diff diff --git a/include/linux/capability.h b/include/linux/capability.h index 7d50ff6d269f..eaab759b1460 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h @@ -155,6 +155,7 @@ typedef struct kernel_cap_struct { * Add any capability from current's capability bounding set * to the c...
4016a1390d07f15b267eecb20e76a48fd5c524ef
Analyze and fix the following issue in the Linux kernel code: mm/nommu.c: return 0 from kobjsize with invalid objects
Problem Details: Don't perform kobjsize operations on objects the kernel doesn't manage. On Blackfin, drivers can get dma coherent memory by calling a function dma_alloc_coherent(). We do this in nommu by configuring a chunk of uncached memory at the top of memory. Since we don't want the kernel to use the uncached m...
```diff diff --git a/mm/nommu.c b/mm/nommu.c index 5d8ae086f74e..1d32fe89d57b 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -105,7 +105,11 @@ unsigned int kobjsize(const void *objp) { struct page *page; - if (!objp || !((page = virt_to_page(objp)))) + /* + * If the object we have should not have ksize performed on ...
8cece85ec744bdc7ea0fc2d33f65b3f031c28468
Analyze and fix the following issue in the Linux kernel code: mm: fix broken gfp_zone with __GFP_THISNODE
Problem Details: This hack, "base = MAX_NR_ZONES", at __GFP_THISNODE was used for old zonliests. Now, new zonelist[] have a list for __GFP_THISNODE and this hack is incorrect. Should be removed. Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Christoph Lameter <cla...
```diff diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 898aa9d5b6c2..c37653b6843f 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -119,29 +119,22 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags) static inline enum zone_type gfp_zone(gfp_t flags) { - int base = 0; - -#ifdef...
71fe804b6d56d6a7aed680e096901434cef6a2c3
Analyze and fix the following issue in the Linux kernel code: mempolicy: use struct mempolicy pointer in shmem_sb_info
Problem Details: This patch replaces the mempolicy mode, mode_flags, and nodemask in the shmem_sb_info struct with a struct mempolicy pointer, initialized to NULL. This removes dependency on the details of mempolicy from shmem.c and hugetlbfs inode.c and simplifies the interfaces. mpol_parse_str() in mempolicy.c is ch...
```diff diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 2e9e5bdd5629..9783723e8ffe 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -504,7 +504,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, uid_t uid, inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIM...
2291990ab36b4b2d8a81b1f92e7a046e51632a60
Analyze and fix the following issue in the Linux kernel code: mempolicy: clean-up mpol-to-str() mempolicy formatting
Problem Details: mpol-to-str() formats memory policies into printable strings. Currently this is only used to display "numa_maps". A subsequent patch will use mpol_to_str() for formatting tmpfs [shmem] mpol mount options, allowing us to remove essentially duplicate code in mm/shmem.c. This patch cleans up mpol_to_st...
```diff diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 143b019e9834..3c8ee31572ec 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1965,6 +1965,11 @@ static inline int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol) unsigned short mode; unsigned short flags = pol ? pol->flags : 0; + /* + * S...
bea904d54d6faa92400f10c8ea3d3828b8e1eb93
Analyze and fix the following issue in the Linux kernel code: mempolicy: use MPOL_PREFERRED for system-wide default policy
Problem Details: Currently, when one specifies MPOL_DEFAULT via a NUMA memory policy API [set_mempolicy(), mbind() and internal versions], the kernel simply installs a NULL struct mempolicy pointer in the appropriate context: task policy, vma policy, or shared policy. This causes any use of that policy to "fall back" ...
```diff diff --git a/Documentation/vm/numa_memory_policy.txt b/Documentation/vm/numa_memory_policy.txt index 6719d642653f..13cca5a3cf17 100644 --- a/Documentation/vm/numa_memory_policy.txt +++ b/Documentation/vm/numa_memory_policy.txt @@ -147,35 +147,18 @@ Components of Memory Policies Linux memory policy support...
52cd3b074050dd664380b5e8cfc85d4a6ed8ad48
Analyze and fix the following issue in the Linux kernel code: mempolicy: rework mempolicy Reference Counting [yet again]
Problem Details: After further discussion with Christoph Lameter, it has become clear that my earlier attempts to clean up the mempolicy reference counting were a bit of overkill in some areas, resulting in superflous ref/unref in what are usually fast paths. In other areas, further inspection reveals that I botched t...
```diff diff --git a/Documentation/vm/numa_memory_policy.txt b/Documentation/vm/numa_memory_policy.txt index 27b9507a3769..6719d642653f 100644 --- a/Documentation/vm/numa_memory_policy.txt +++ b/Documentation/vm/numa_memory_policy.txt @@ -311,6 +311,74 @@ Components of Memory Policies MPOL_PREFERRED policies that...
ae4d8c16aa22775f5731677abb8a82f03cec877e
Analyze and fix the following issue in the Linux kernel code: mempolicy: fixup Fallback for Default Shmem Policy
Problem Details: get_vma_policy() is not handling fallback to task policy correctly when the get_policy() vm_op returns NULL. The NULL overwrites the 'pol' variable that was holding the fallback task mempolicy. So, it was falling back directly to system default policy. Fix get_vma_policy() to use only non-NULL polic...
```diff diff --git a/ipc/shm.c b/ipc/shm.c index cc63fae02f06..8d1b2c468cc4 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -274,8 +274,7 @@ static struct mempolicy *shm_get_policy(struct vm_area_struct *vma, else if (vma->vm_policy) { pol = vma->vm_policy; mpol_get(pol); /* get_vma_policy() expects this */ - } else ...
7e675137a8e1a4d45822746456dd389b65745bf6
Analyze and fix the following issue in the Linux kernel code: mm: introduce pte_special pte bit
Problem Details: s390 for one, cannot implement VM_MIXEDMAP with pfn_valid, due to their memory model (which is more dynamic than most). Instead, they had proposed to implement it with an additional path through vm_normal_page(), using a bit in the pte to determine whether or not the page should be refcounted: vm_nor...
```diff diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h index 99037b032357..05ce5fba43e3 100644 --- a/include/asm-alpha/pgtable.h +++ b/include/asm-alpha/pgtable.h @@ -268,6 +268,7 @@ extern inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_FOW); } extern inline int pte_dirty(pte_...
214e471ff99064726b2d8af3aa0e24a73c775531
Analyze and fix the following issue in the Linux kernel code: smaps: account swap entries
Problem Details: Show the amount of swap for each vma. This can be used to see where all the swap goes. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Matt Mackall <mpm@selenic.com> Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-...
```diff diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index f4ab76c7c662..7415eeb7cc3a 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -338,8 +338,7 @@ const struct file_operations proc_maps_operations = { #define PSS_SHIFT 12 #ifdef CONFIG_PROC_PAGE_MONITOR -struct mem_size_stats -{ +struct mem_...
bf2ae2b37c06cc9fb6fc03d99617f1161939980f
Analyze and fix the following issue in the Linux kernel code: pageflags: standardize comment inclusion in asm-offsets.h and fix MIPS
Problem Details: Add the ability to pass comments into asm-offsets.h by generating asm output like -># comment line Mips needs this feature to preserve the comments that are in asm-mips/asm-offsets.h right now. Then remove the special handling for mips from Kbuild and convert mips to use the new string to include th...
```diff diff --git a/Kbuild b/Kbuild index 7136de7b6fcb..32f19c5c9bb0 100644 --- a/Kbuild +++ b/Kbuild @@ -52,10 +52,10 @@ targets += arch/$(SRCARCH)/kernel/asm-offsets.s # Default sed regexp - multiline due to syntax constraints define sed-y - "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; ...
726b80127239aeea9c8d8aad5b4e2c80313e3ce8
Analyze and fix the following issue in the Linux kernel code: page_mapping(): add ifdef around reference to swapper_space
Problem Details: This fixes the superh build when the pageflags patches are applied. But it shouldn't unless it's a gcc bug. Cc: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/include/linux/mm.h b/include/linux/mm.h index 24659ed06bae..4f3c1b2f44de 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -605,9 +605,12 @@ static inline struct address_space *page_mapping(struct page *page) struct address_space *mapping = page->mapping; VM_BUG_ON(PageSlab(page)); ...
2301696932b55e2ea2085cefc84f7b94fa2dd54b
Analyze and fix the following issue in the Linux kernel code: vmallocinfo: add caller information
Problem Details: Add caller information so that /proc/vmallocinfo shows where the allocation request for a slice of vmalloc memory originated. Results in output like this: 0xffffc20000000000-0xffffc20000801000 8392704 alloc_large_system_hash+0x127/0x246 pages=2048 vmalloc vpages 0xffffc20000801000-0xffffc20000806000 ...
```diff diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index d176b23110cc..804de18abcc2 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -117,8 +117,8 @@ int ioremap_change_attr(unsigned long vaddr, unsigned long size, * have to convert them into an offset in a page-aligned mapping, but t...
a10aa579878fc6f9cd17455067380bbdf1d53c91
Analyze and fix the following issue in the Linux kernel code: vmalloc: show vmalloced areas via /proc/vmallocinfo
Problem Details: Implement a new proc file that allows the display of the currently allocated vmalloc memory. It allows to see the users of vmalloc. That is important if vmalloc space is scarce (i386 for example). And it's going to be important for the compound page fallback to vmalloc. Many of the current users can...
```diff diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 2d563979cb02..441a32f0e5f2 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c @@ -456,6 +456,20 @@ static const struct file_operations proc_slabstats_operations = { #endif #endif +#ifdef CONFIG_MMU +static int vmalloc_open(struct inode *in...
b45445684198a946b587732265692e6495993abf
Analyze and fix the following issue in the Linux kernel code: mm: make early_pfn_to_nid() a C function
Problem Details: Fix this (sparc64) mm/sparse-vmemmap.c: In function `vmemmap_verify': mm/sparse-vmemmap.c:64: warning: unused variable `pfn' by switching to a C function which touches its arg. (reason 3,555 why macros are bad) Also, the `nid' arg was misnamed. Reviewed-by: Christoph Lameter <clameter@sgi.com> Ack...
```diff diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 498d6ceff2f4..0aece6d8937e 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -841,7 +841,10 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, #if !defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID) && ...
f05111f50105ac479a008cf85749cf9c956453ea
Analyze and fix the following issue in the Linux kernel code: mm/page_alloc.c: fix indentation
Problem Details: zlc_setup(): handle jiffies wraparound (10ed273f5016c582413dfbc468dd084957d847e1) changes tab with spaces Signed-off-by: S.Caglar Onur <caglar@pardus.org.tr> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com> Cc: Paul Jackson <pj@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off...
```diff diff --git a/mm/page_alloc.c b/mm/page_alloc.c index b4beb3eea8b7..af28e2cec8b4 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1284,7 +1284,7 @@ static nodemask_t *zlc_setup(struct zonelist *zonelist, int alloc_flags) if (!zlc) return NULL; - if (time_after(jiffies, zlc->last_full_zap + HZ)...
b5ee5befa75e33e55d34584ad10286c5005cb1de
Analyze and fix the following issue in the Linux kernel code: dmapool: enable debugging for CONFIG_SLUB_DEBUG_ON too
Problem Details: Previously it was only enabled for CONFIG_DEBUG_SLAB. Not hooked into the slub runtime debug configuration, so you currently only get it with CONFIG_SLUB_DEBUG_ON, not plain CONFIG_SLUB_DEBUG Acked-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Andrew...
```diff diff --git a/mm/dmapool.c b/mm/dmapool.c index 34aaac451a96..b1f0885dda22 100644 --- a/mm/dmapool.c +++ b/mm/dmapool.c @@ -37,6 +37,10 @@ #include <linux/types.h> #include <linux/wait.h> +#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB_DEBUG_ON) +#define DMAPOOL_DEBUG 1 +#endif + struct dma_pool { /...
a43361cf3cb6fb6431fdbfb0f3ef26a334826160
Analyze and fix the following issue in the Linux kernel code: mempolicy: fix parsing of tmpfs mpol mount option
Problem Details: Parsing of new mode flags in the tmpfs mpol mount option is slightly broken: Setting a valid flag works OK: #mount -o remount,mpol=bind=static:1-2 /dev/shm #mount ... tmpfs on /dev/shm type tmpfs (rw,mpol=bind=static:1-2) ... However, we can't remove them or change them, once we've set a valid f...
```diff diff --git a/mm/shmem.c b/mm/shmem.c index 9435f298dd75..177c7a7d2bb3 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1125,20 +1125,26 @@ static int shmem_parse_mpol(char *value, unsigned short *policy, *policy_nodes = node_states[N_HIGH_MEMORY]; err = 0; } + + *mode_flags = 0; if (flags) { + /* + * ...
3e1f064562fcff7bf3856bc1d00dfa84d4f121cc
Analyze and fix the following issue in the Linux kernel code: mempolicy: disallow static or relative flags for local preferred mode
Problem Details: MPOL_F_STATIC_NODES and MPOL_F_RELATIVE_NODES don't mean anything for MPOL_PREFERRED policies that were created with an empty nodemask (for purely local allocations). They'll never be invalidated because the allowed mems of a task changes or need to be rebound relative to a cpuset's placement. Also f...
```diff diff --git a/Documentation/vm/numa_memory_policy.txt b/Documentation/vm/numa_memory_policy.txt index 706410dfb9e5..1c7dd21623d2 100644 --- a/Documentation/vm/numa_memory_policy.txt +++ b/Documentation/vm/numa_memory_policy.txt @@ -205,6 +205,12 @@ Components of Memory Policies local allocation for a speci...
37012946da940521fb997a758a219d2f1ab56e51
Analyze and fix the following issue in the Linux kernel code: mempolicy: create mempolicy_operations structure
Problem Details: Create a mempolicy_operations structure that currently points to two functions[*] for the various modes: int (*create)(struct mempolicy *, const nodemask_t *); void (*rebind)(struct mempolicy *, const nodemask_t *); This splits the implementation for the various modes out of two large functions, mp...
```diff diff --git a/mm/mempolicy.c b/mm/mempolicy.c index d44c524e5ae4..a94d994eaaa8 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -63,7 +63,6 @@ grows down? make bind policy root only? It can trigger oom much faster and the kernel is not always grateful with that. - could replace all the switch()e...
028fec414d803117eb4b2ed12acb4dd5da65b32d
Analyze and fix the following issue in the Linux kernel code: mempolicy: support optional mode flags
Problem Details: With the evolution of mempolicies, it is necessary to support mempolicy mode flags that specify how the policy shall behave in certain circumstances. The most immediate need for mode flag support is to suppress remapping the nodemask of a policy at the time of rebind. Both the mempolicy mode and flag...
```diff diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 6846785fe904..2e9e5bdd5629 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -504,7 +504,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, uid_t uid, inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIM...
dd1a239f6f2d4d3eedd318583ec319aa145b324c
Analyze and fix the following issue in the Linux kernel code: mm: have zonelist contains structs with both a zone pointer and zone_idx
Problem Details: Filtering zonelists requires very frequent use of zone_idx(). This is costly as it involves a lookup of another structure and a substraction operation. As the zone_idx is often required, it should be quickly accessible. The node idx could also be stored here if it was found that accessing zone->node...
```diff diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 9bb6136d77c2..1f012843150f 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -608,7 +608,7 @@ void show_mem(void) for (i = 0; i < npmem_ranges; i++) { zl = node_zonelist(i); for (j = 0; j < MAX_NR_ZONES; j++) { - stru...
dac1d27bc8d5ca636d3014ecfdf94407031d1970
Analyze and fix the following issue in the Linux kernel code: mm: use zonelists instead of zones when direct reclaiming pages
Problem Details: The following patches replace multiple zonelists per node with two zonelists that are filtered based on the GFP flags. The patches as a set fix a bug with regard to the use of MPOL_BIND and ZONE_MOVABLE. With this patchset, the MPOL_BIND will apply to the two highest zones when the highest zone is ZO...
```diff diff --git a/fs/buffer.c b/fs/buffer.c index 8b9807523efe..1dae94acb3fe 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -360,16 +360,16 @@ void invalidate_bdev(struct block_device *bdev) */ static void free_more_memory(void) { - struct zone **zones; + struct zonelist *zonelist; pg_data_t *pgdat; wakeup_...
0dd1334faf7e075bfdb6f5284eed65210b296fc1
Analyze and fix the following issue in the Linux kernel code: fix invalidate_inode_pages2_range() to not clear ret
Problem Details: DIO invalidates page cache through invalidate_inode_pages2_range(). invalidate_inode_pages2_range() sets ret=-EIO when invalidate_complete_page2() fails, but this ret is cleared if do_launder_page() succeed on a page of next index. In this case, dio is carried out even if invalidate_complete_page2() f...
```diff diff --git a/mm/truncate.c b/mm/truncate.c index 7d20ce41ecf5..b8961cb63414 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -391,6 +391,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping, pgoff_t next; int i; int ret = 0; + int ret2 = 0; int did_range_unmap = 0; int wrapped = 0; ...
ddc81ed2c5d47a078a3b02c5c3a4345bc2bc3c9b
Analyze and fix the following issue in the Linux kernel code: remove sparse warning for mmzone.h
Problem Details: include/linux/mmzone.h:640:22: warning: potentially expensive pointer subtraction Calculate the offset into the node_zones array rather than the index using casts to (char *) and comparing against the index * sizeof(struct zone). On X86_32 this saves a sar, but code size increases by one byte per is_...
```diff diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 9f274a687c7e..451eaa13bc28 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -637,9 +637,10 @@ static inline int is_normal_idx(enum zone_type idx) static inline int is_highmem(struct zone *zone) { #ifdef CONFIG_HIGHMEM - int...
180c06efce691f2b721dd0d965079827bdd7ee03
Analyze and fix the following issue in the Linux kernel code: hotplug-memory: make online_page() common
Problem Details: All architectures use an effectively identical definition of online_page(), so just make it common code. x86-64, ia64, powerpc and sh are actually identical; x86-32 is slightly different. x86-32's differences arise because it puts its hotplug pages in the highmem zone. We can handle this in the gene...
```diff diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index 5c1de53c8c1c..fc6c6636ffda 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c @@ -682,15 +682,6 @@ mem_init (void) } #ifdef CONFIG_MEMORY_HOTPLUG -void online_page(struct page *page) -{ - ClearPageReserved(page); - init_page_count(page); -...
e2bfe3424b368e977002fc58f81536d5d8ea9449
Analyze and fix the following issue in the Linux kernel code: rtc: rtc-rs5c372: fix up NULL name in transfer error path
Problem Details: rs5c_get_regs() currently uses rs5c->rtc->name for its debug printk when i2c_transfer() fails, though it is used several times before the rtc dev has been registered. The earliest we can get at the symbolic name is via the i2c client's struct device, which can be handled by moving the first rs5c_get_re...
```diff diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c index 6b67b5097927..67d8768c1b64 100644 --- a/drivers/rtc/rtc-rs5c372.c +++ b/drivers/rtc/rtc-rs5c372.c @@ -99,7 +99,7 @@ static int rs5c_get_regs(struct rs5c372 *rs5c) * least 80219 chips; this works around that bug. */ if ((i2c_transfe...
c464652813fe128c346ce6e7ec8fb0d2b67de6fb
Analyze and fix the following issue in the Linux kernel code: rtc: silence section mismatch warning in rtc-test
Problem Details: Fix following warning: WARNING: vmlinux.o(.data+0x253e28): Section mismatch in reference from the variable test_drv to the function .devexit.text:test_remove() Fix by renaming the platfrom_driver variable from *_drv to *_driver so modpost ignore the reference to an __devexit section. Signed-off-by: S...
```diff diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c index 254c9fce27da..bc930022004a 100644 --- a/drivers/rtc/rtc-test.c +++ b/drivers/rtc/rtc-test.c @@ -147,7 +147,7 @@ static int __devexit test_remove(struct platform_device *plat_dev) return 0; } -static struct platform_driver test_drv = { +stat...
4edac2b442d6176afb0ae431123993dc00882987
Analyze and fix the following issue in the Linux kernel code: rtc-x1205: new style conversion
Problem Details: [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c index b90fb1866ce9..bb3290360091 100644 --- a/drivers/rtc/rtc-x1205.c +++ b/drivers/rtc/rtc-x1205.c @@ -22,20 +22,7 @@ #include <linux/rtc.h> #include <linux/delay.h> -#define DRV_VERSION "1.0.7" - -/* Addresses to scan: none. This chip is locat...
e5fc9cc0266e5babcf84c81908ec8843b7e3349f
Analyze and fix the following issue in the Linux kernel code: rtc-pcf8563: new style conversion
Problem Details: [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c index b3317fcc16c3..a1e2f39521f8 100644 --- a/drivers/rtc/rtc-pcf8563.c +++ b/drivers/rtc/rtc-pcf8563.c @@ -18,17 +18,7 @@ #include <linux/bcd.h> #include <linux/rtc.h> -#define DRV_VERSION "0.4.2" - -/* Addresses to scan: none - * This chip...
9edae7bcdcbac2dbf037b751ce1809eb2758cd8e
Analyze and fix the following issue in the Linux kernel code: rtc-isl1208: new style conversion and minor bug fixes
Problem Details: [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Cc: Herbert Valerio Riedel <hvr@gnu.org> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c index 725b0c73c333..fb15e3fb4ce2 100644 --- a/drivers/rtc/rtc-isl1208.c +++ b/drivers/rtc/rtc-isl1208.c @@ -15,16 +15,15 @@ #include <linux/bcd.h> #include <linux/rtc.h> -#define DRV_NAME "isl1208" -#define DRV_VERSION "0.2" +#define DRV_VER...
c750090085f260503d8beec1c73c4d2e4fe93628
Analyze and fix the following issue in the Linux kernel code: rtc: avoid legacy drivers with generic framework
Problem Details: Kconfig tweaks to help reduce RTC configuration bugs, by avoiding legacy RTC drivers when the generic RTC framework is enabled: - If rtc-cmos is selected, disable the legacy rtc driver; - When using generic RTC on x86, enable rtc-cmos by default; - In the old "chardev RTC" section of Kconfig, add...
```diff diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 2906ee7bd298..929d4fa73fd9 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -732,9 +732,16 @@ config NVRAM To compile this driver as a module, choose M here: the module will be called nvram. +# +# These legacy RTC drivers ju...
77459b059b02c16b2c8cbc39b524941a576ad36e
Analyze and fix the following issue in the Linux kernel code: rtc-pcf8583 build fix
Problem Details: Fix bogus #include in rtc-pcf8583, so it compiles on platforms that don't support PC clone RTCs. (Original issue noted by Adrian Bunk.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Adrian Bunk <bunk@kernel.org> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Cc: <stable@kerne...
```diff diff --git a/drivers/rtc/rtc-pcf8583.c b/drivers/rtc/rtc-pcf8583.c index 8b3997007506..3d09d8f0b1f0 100644 --- a/drivers/rtc/rtc-pcf8583.c +++ b/drivers/rtc/rtc-pcf8583.c @@ -15,7 +15,7 @@ #include <linux/i2c.h> #include <linux/slab.h> #include <linux/string.h> -#include <linux/mc146818rtc.h> +#include <linu...
1ecf0d0cd28a4bfed3009f752061998e52d14db2
Analyze and fix the following issue in the Linux kernel code: dz: test after postfix decrement fails in dz_console_putchar()
Problem Details: When loops reaches 0 the postfix decrement still subtracts, so the subsequent test fails. Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Acked-by: Maciej W. Rozycki <macro@linux-mips.org> Cc: Johannes Weiner <hannes@saeurebad.de> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundatio...
```diff diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c index 116211fcd36f..0dddd68b20d2 100644 --- a/drivers/serial/dz.c +++ b/drivers/serial/dz.c @@ -819,7 +819,7 @@ static void dz_console_putchar(struct uart_port *uport, int ch) dz_out(dport, DZ_TCR, mask); iob(); udelay(2); - } while (loops--); + } ...
556637cdabcd5918c7d4a1a2679b8f86fc81e891
Analyze and fix the following issue in the Linux kernel code: mm: fix possible off-by-one in walk_pte_range()
Problem Details: After the loop in walk_pte_range() pte might point to the first address after the pmd it walks. The pte_unmap() is then applied to something bad. Spotted by Roel Kluin and Andreas Schwab. Signed-off-by: Johannes Weiner <hannes@saeurebad.de> Cc: Roel Kluin <12o3l@tiscali.nl> Cc: Andreas Schwab <schwa...
```diff diff --git a/mm/pagewalk.c b/mm/pagewalk.c index 1cf1417ef8b7..0afd2387e507 100644 --- a/mm/pagewalk.c +++ b/mm/pagewalk.c @@ -9,11 +9,15 @@ static int walk_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, int err = 0; pte = pte_offset_map(pmd, addr); - do { + for (;;) { err = walk->pte_ent...
f022bfd58253099102218db5249220a7f4787114
Analyze and fix the following issue in the Linux kernel code: x86: PAT fix
Problem Details: Adrian Bunk noticed the following Coverity report: > Commit e7f260a276f2c9184fe753732d834b1f6fbe9f17 > (x86: PAT use reserve free memtype in mmap of /dev/mem) > added the following gem to arch/x86/mm/pat.c: > > <-- snip --> > > ... > int phys_mem_access_prot_allowed(struct file *file, unsigned long ...
```diff diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index b17cdf64e41e..277446cd30b6 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c @@ -510,7 +510,6 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, { u64 offset = ((u64) pfn) << PAGE_SHIFT; unsigned long flags = _PAGE_CACHE_U...
7719e437fac119e57b17588bab3a8e39ff9d22eb
Analyze and fix the following issue in the Linux kernel code: [PATCH 2/2] audit: fix sparse shadowed variable warnings
Problem Details: Use msglen as the identifier. kernel/audit.c:724:10: warning: symbol 'len' shadows an earlier one kernel/audit.c:575:8: originally declared here Don't use ino_f to check the inode field at the end of the functions. kernel/auditfilter.c:429:22: warning: symbol 'f' shadows an earlier one kernel/auditfil...
```diff diff --git a/kernel/audit.c b/kernel/audit.c index 5b9ad3dda885..f4799eb6977a 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -813,21 +813,21 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) case AUDIT_MAKE_EQUIV: { void *bufp = data; u32 sizes[2]; - size_t len = nlmsg_len...
f09ac9db2aafe36fde9ebd63c8c5d776f6e7bd41
Analyze and fix the following issue in the Linux kernel code: Audit: stop deadlock from signals under load
Problem Details: A deadlock is possible between kauditd and auditd under load if auditd receives a signal. When auditd receives a signal it sends a netlink message to the kernel asking for information about the sender of the signal. In that same context the audit system will attempt to send a netlink message back to ...
```diff diff --git a/kernel/audit.c b/kernel/audit.c index fee9052eb5cf..520583d8ca18 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -156,6 +156,11 @@ struct audit_buffer { gfp_t gfp_mask; }; +struct audit_reply { + int pid; + struct sk_buff *skb; +}; + static void audit_set_pid(struct audit_buffer *ab...
39da9847113a870b20fee9a7c216a848b9a5e9f7
Analyze and fix the following issue in the Linux kernel code: [CIFS] Fix statfs formatting
Problem Details: Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Steve French <sfrench@us.ibm.com>
```diff diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES index 05c9da6181c3..8355e918fddf 100644 --- a/fs/cifs/CHANGES +++ b/fs/cifs/CHANGES @@ -1,3 +1,6 @@ +Version 1.53 +------------ + Version 1.52 ------------ Fix oops on second mount to server when null auth is used. diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs....
c9b7b9793764b171a118d049d4b721a7f5d8ac82
Analyze and fix the following issue in the Linux kernel code: SELinux: Fix a RCU free problem with the netport cache
Problem Details: The netport cache doesn't free resources in a manner which is safe or orderly. This patch fixes this by adding in a missing call to rcu_dereference() in sel_netport_insert() as well as some general cleanup throughout the file. Signed-off-by: Paul Moore <paul.moore@hp.com> Signed-off-by: James Morris <...
```diff diff --git a/security/selinux/netport.c b/security/selinux/netport.c index 68ede3c498ab..90b4cff7c350 100644 --- a/security/selinux/netport.c +++ b/security/selinux/netport.c @@ -114,8 +114,7 @@ static struct sel_netport *sel_netport_find(u8 protocol, u16 pnum) idx = sel_netport_hashfn(pnum); list_for_eac...