Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285841
b: refs/heads/master
c: 012f3b9
h: refs/heads/master
i:
  285839: 086fa00
v: v3
  • Loading branch information
Eric Miao authored and Jean Delvare committed Jan 16, 2012
1 parent b1f2b30 commit e33490c
Show file tree
Hide file tree
Showing 40 changed files with 136 additions and 818 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97740400bc76b64781d01f8cdfbcf750582006ef
refs/heads/master: 012f3b9118c7aaa3549f89299386f92b6580d235
10 changes: 2 additions & 8 deletions trunk/Documentation/coccinelle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,9 @@ or
make coccicheck COCCI=<my_SP.cocci> MODE=report


Controlling Which Files are Processed by Coccinelle
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By default the entire kernel source tree is checked.

To apply Coccinelle to a specific directory, M= can be used.
For example, to check drivers/net/wireless/ one may write:
Using Coccinelle on (modified) files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

make coccicheck M=drivers/net/wireless/

To apply Coccinelle on a file basis, instead of a directory basis, the
following command may be used:

Expand Down
2 changes: 1 addition & 1 deletion trunk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ endif
# If the user is running make -s (silent mode), suppress echoing of
# commands

ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
ifneq ($(findstring s,$(MAKEFLAGS)),)
quiet=silent_
endif

Expand Down
6 changes: 2 additions & 4 deletions trunk/arch/arm/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE

endif

targets += $(dtb-y)

# Rule to build device tree blobs
$(obj)/%.dtb: $(src)/dts/%.dts FORCE
$(call if_changed_dep,dtc)
$(obj)/%.dtb: $(src)/dts/%.dts
$(call cmd,dtc)

$(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-shmobile/pm-sh7372.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static int sh7372_a3sp_suspend(void)
* Serial consoles make use of SCIF hardware located in A3SP,
* keep such power domain on if "no_console_suspend" is set.
*/
return console_suspend_enabled ? 0 : -EBUSY;
return console_suspend_enabled ? -EBUSY : 0;
}

struct sh7372_pm_domain sh7372_a3sp = {
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/microblaze/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ $(obj)/simpleImage.%: vmlinux FORCE
DTC_FLAGS := -p 1024

$(obj)/%.dtb: $(src)/dts/%.dts FORCE
$(call if_changed_dep,dtc)
$(call cmd,dtc)

clean-files += *.dtb simpleImage.*.unstrip linux.bin.ub
4 changes: 2 additions & 2 deletions trunk/arch/openrisc/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ clean-files := *.dtb.S

#DTC_FLAGS ?= -p 1024

$(obj)/%.dtb: $(src)/dts/%.dts FORCE
$(call if_changed_dep,dtc)
$(obj)/%.dtb: $(src)/dts/%.dts
$(call cmd,dtc)
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ $(obj)/treeImage.%: vmlinux $(obj)/%.dtb $(wrapperbits)
$(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb)

# Rule to build device tree blobs
$(obj)/%.dtb: $(src)/dts/%.dts FORCE
$(call if_changed_dep,dtc)
$(obj)/%.dtb: $(src)/dts/%.dts
$(call cmd,dtc)

# If there isn't a platform selected then just strip the vmlinux.
ifeq (,$(image-y))
Expand Down
15 changes: 0 additions & 15 deletions trunk/drivers/base/power/domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -1429,8 +1429,6 @@ static int pm_genpd_default_restore_state(struct device *dev)
return 0;
}

#ifdef CONFIG_PM_SLEEP

/**
* pm_genpd_default_suspend - Default "device suspend" for PM domians.
* @dev: Device to handle.
Expand Down Expand Up @@ -1519,19 +1517,6 @@ static int pm_genpd_default_thaw(struct device *dev)
return cb ? cb(dev) : pm_generic_thaw(dev);
}

#else /* !CONFIG_PM_SLEEP */

#define pm_genpd_default_suspend NULL
#define pm_genpd_default_suspend_late NULL
#define pm_genpd_default_resume_early NULL
#define pm_genpd_default_resume NULL
#define pm_genpd_default_freeze NULL
#define pm_genpd_default_freeze_late NULL
#define pm_genpd_default_thaw_early NULL
#define pm_genpd_default_thaw NULL

#endif /* !CONFIG_PM_SLEEP */

/**
* pm_genpd_init - Initialize a generic I/O PM domain object.
* @genpd: PM domain object to initialize.
Expand Down
24 changes: 5 additions & 19 deletions trunk/drivers/base/power/domain_governor.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#include <linux/pm_qos.h>
#include <linux/hrtimer.h>

#ifdef CONFIG_PM_RUNTIME

/**
* default_stop_ok - Default PM domain governor routine for stopping devices.
* @dev: Device to check.
Expand Down Expand Up @@ -139,28 +137,16 @@ static bool default_power_down_ok(struct dev_pm_domain *pd)
return true;
}

static bool always_on_power_down_ok(struct dev_pm_domain *domain)
{
return false;
}

#else /* !CONFIG_PM_RUNTIME */

bool default_stop_ok(struct device *dev)
{
return false;
}

#define default_power_down_ok NULL
#define always_on_power_down_ok NULL

#endif /* !CONFIG_PM_RUNTIME */

struct dev_power_governor simple_qos_governor = {
.stop_ok = default_stop_ok,
.power_down_ok = default_power_down_ok,
};

static bool always_on_power_down_ok(struct dev_pm_domain *domain)
{
return false;
}

/**
* pm_genpd_gov_always_on - A governor implementing an always-on policy
*/
Expand Down
15 changes: 9 additions & 6 deletions trunk/drivers/hwmon/max1111.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,14 @@ static ssize_t show_adc(struct device *dev,
if (ret < 0)
return ret;

return sprintf(buf, "%d\n", ret);
/* assume the reference voltage to be 2.048V, with an 8-bit sample,
* the LSB weight is 8mV
*/
return sprintf(buf, "%d\n", ret * 8);
}

#define MAX1111_ADC_ATTR(_id) \
SENSOR_DEVICE_ATTR(adc##_id##_in, S_IRUGO, show_adc, NULL, _id)
SENSOR_DEVICE_ATTR(in##_id##_input, S_IRUGO, show_adc, NULL, _id)

static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
static MAX1111_ADC_ATTR(0);
Expand All @@ -120,10 +123,10 @@ static MAX1111_ADC_ATTR(3);

static struct attribute *max1111_attributes[] = {
&dev_attr_name.attr,
&sensor_dev_attr_adc0_in.dev_attr.attr,
&sensor_dev_attr_adc1_in.dev_attr.attr,
&sensor_dev_attr_adc2_in.dev_attr.attr,
&sensor_dev_attr_adc3_in.dev_attr.attr,
&sensor_dev_attr_in0_input.dev_attr.attr,
&sensor_dev_attr_in1_input.dev_attr.attr,
&sensor_dev_attr_in2_input.dev_attr.attr,
&sensor_dev_attr_in3_input.dev_attr.attr,
NULL,
};

Expand Down
3 changes: 2 additions & 1 deletion trunk/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ CFLAGS_REMOVE_irq_work.o = -pg
endif

obj-y += sched/
obj-y += power/

obj-$(CONFIG_FREEZER) += freezer.o
obj-$(CONFIG_PROFILING) += profile.o
Expand Down Expand Up @@ -53,6 +52,8 @@ obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
obj-$(CONFIG_UID16) += uid16.o
obj-$(CONFIG_MODULES) += module.o
obj-$(CONFIG_KALLSYMS) += kallsyms.o
obj-$(CONFIG_PM) += power/
obj-$(CONFIG_FREEZER) += power/
obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
obj-$(CONFIG_KEXEC) += kexec.o
obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
Expand Down
13 changes: 6 additions & 7 deletions trunk/kernel/power/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,8 @@ static int enough_swap(unsigned int nr_pages, unsigned int flags)

pr_debug("PM: Free swap pages: %u\n", free_swap);

required = PAGES_FOR_IO + nr_pages;
required = PAGES_FOR_IO + ((flags & SF_NOCOMPRESS_MODE) ?
nr_pages : (nr_pages * LZO_CMP_PAGES) / LZO_UNC_PAGES + 1);
return free_swap > required;
}

Expand Down Expand Up @@ -801,12 +802,10 @@ int swsusp_write(unsigned int flags)
printk(KERN_ERR "PM: Cannot get swap writer\n");
return error;
}
if (flags & SF_NOCOMPRESS_MODE) {
if (!enough_swap(pages, flags)) {
printk(KERN_ERR "PM: Not enough free swap\n");
error = -ENOSPC;
goto out_finish;
}
if (!enough_swap(pages, flags)) {
printk(KERN_ERR "PM: Not enough free swap\n");
error = -ENOSPC;
goto out_finish;
}
memset(&snapshot, 0, sizeof(struct snapshot_handle));
error = snapshot_read_next(&snapshot);
Expand Down
8 changes: 4 additions & 4 deletions trunk/scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ obj-dirs := $(addprefix $(obj)/,$(obj-dirs))
# already
# $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will
# end up in (or would, if it gets compiled in)
# Note: Files that end up in two or more modules are compiled without the
# KBUILD_MODNAME definition. The reason is that any made-up name would
# differ in different configs.
# Note: It's possible that one object gets potentially linked into more
# than one module. In that case KBUILD_MODNAME will be set to foo_bar,
# where foo and bar are the name of the modules.
name-fix = $(subst $(comma),_,$(subst -,_,$1))
basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
modname_flags = $(if $(filter 1,$(words $(modname))),\
Expand Down Expand Up @@ -264,7 +264,7 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
$(call cmd,dt_S_dtb)

quiet_cmd_dtc = DTC $@
cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $<
cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $<

# Bzip2
# ---------------------------------------------------------------------------
Expand Down
19 changes: 5 additions & 14 deletions trunk/scripts/coccicheck
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,14 @@ if [ "$C" = "1" -o "$C" = "2" ]; then
# FLAGS="-ignore_unknown_options -very_quiet"
# OPTIONS=$*

if [ "$KBUILD_EXTMOD" = "" ] ; then
# Workaround for Coccinelle < 0.2.3
FLAGS="-I $srctree/include -very_quiet"
shift $(( $# - 1 ))
OPTIONS=$1
else
echo M= is not currently supported when C=1 or C=2
exit 1
fi
# Workaround for Coccinelle < 0.2.3
FLAGS="-I $srctree/include -very_quiet"
shift $(( $# - 1 ))
OPTIONS=$1
else
ONLINE=0
FLAGS="-very_quiet"
if [ "$KBUILD_EXTMOD" = "" ] ; then
OPTIONS="-dir $srctree"
else
OPTIONS="-dir $KBUILD_EXTMOD -patch $srctree -I $srctree/include -I $KBUILD_EXTMOD/include"
fi
OPTIONS="-dir $srctree"
fi

if [ ! -x "$SPATCH" ]; then
Expand Down
105 changes: 0 additions & 105 deletions trunk/scripts/coccinelle/api/devm_request_and_ioremap.cocci

This file was deleted.

Loading

0 comments on commit e33490c

Please sign in to comment.