diff --git a/Makefile b/Makefile index 7bece7a1f052..528a53858ae9 100755 --- a/Makefile +++ b/Makefile @@ -760,6 +760,8 @@ KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,) KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior) KBUILD_CFLAGS += $(call cc-option, -no-integrated-as) KBUILD_AFLAGS += $(call cc-option, -no-integrated-as) +KBUILD_CFLAGS += $(call cc-option, -fno-builtin-bcmp) +KBUILD_AFLAGS += $(call cc-option, -fno-builtin-bcmp) else # These warnings generated too much noise in a regular build. @@ -830,6 +832,9 @@ CHECKFLAGS += $(NOSTDINC_FLAGS) # warn about C99 declaration after statement KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) +# warn about bad indentation +KBUILD_CFLAGS += $(call cc-option,-Wmisleading-indentation,) + # disable pointer signed / unsigned warnings in gcc 4.0 KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign) diff --git a/drivers/battery_v2/sec_battery.c b/drivers/battery_v2/sec_battery.c index 8af67d97cead..2fd30414f741 100755 --- a/drivers/battery_v2/sec_battery.c +++ b/drivers/battery_v2/sec_battery.c @@ -5916,14 +5916,14 @@ ssize_t sec_bat_store_attrs( break; #if defined(CONFIG_BATTERY_CISD) case CISD_DATA: - { - struct cisd *pcisd = &battery->cisd; - int temp_data[CISD_DATA_MAX_PER_DAY] = {0,}; + { + struct cisd *pcisd = &battery->cisd; + int temp_data[CISD_DATA_MAX_PER_DAY] = {0,}; - sscanf(buf, "%10d\n", &temp_data[0]); + sscanf(buf, "%10d\n", &temp_data[0]); - if (temp_data[CISD_DATA_RESET_ALG] > 0) { - if (sscanf(buf, "%10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d\n", + if (temp_data[CISD_DATA_RESET_ALG] > 0) { + if (sscanf(buf, "%10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d, %10d\n", &temp_data[0], &temp_data[1], &temp_data[2], &temp_data[3], &temp_data[4], &temp_data[5], &temp_data[6], &temp_data[7], &temp_data[8], @@ -5950,111 +5950,111 @@ ssize_t sec_bat_store_attrs( &temp_data[69], &temp_data[70], &temp_data[71], &temp_data[72], &temp_data[73], &temp_data[74], &temp_data[75], &temp_data[76]) <= CISD_DATA_MAX_PER_DAY) { - for (i = 0; i < CISD_DATA_MAX_PER_DAY; i++) - pcisd->data[i] = 0; - pcisd->data[CISD_DATA_ALG_INDEX] = battery->pdata->cisd_alg_index; - pcisd->data[CISD_DATA_FULL_COUNT] = temp_data[0]; - pcisd->data[CISD_DATA_CAP_MAX] = temp_data[1]; - pcisd->data[CISD_DATA_CAP_MIN] = temp_data[2]; - pcisd->data[CISD_DATA_VALERT_COUNT] = temp_data[16]; - pcisd->data[CISD_DATA_CYCLE] = temp_data[17]; - pcisd->data[CISD_DATA_WIRE_COUNT] = temp_data[18]; - pcisd->data[CISD_DATA_WIRELESS_COUNT] = temp_data[19]; - pcisd->data[CISD_DATA_HIGH_TEMP_SWELLING] = temp_data[20]; - pcisd->data[CISD_DATA_LOW_TEMP_SWELLING] = temp_data[21]; - pcisd->data[CISD_DATA_SWELLING_CHARGING_COUNT] = temp_data[22]; - pcisd->data[CISD_DATA_AICL_COUNT] = temp_data[26]; - pcisd->data[CISD_DATA_BATT_TEMP_MAX] = temp_data[27]; - pcisd->data[CISD_DATA_BATT_TEMP_MIN] = temp_data[28]; - pcisd->data[CISD_DATA_CHG_TEMP_MAX] = temp_data[29]; - pcisd->data[CISD_DATA_CHG_TEMP_MIN] = temp_data[30]; - pcisd->data[CISD_DATA_WPC_TEMP_MAX] = temp_data[31]; - pcisd->data[CISD_DATA_WPC_TEMP_MIN] = temp_data[32]; - pcisd->data[CISD_DATA_UNSAFETY_VOLTAGE] = temp_data[33]; - pcisd->data[CISD_DATA_UNSAFETY_TEMPERATURE] = temp_data[34]; - pcisd->data[CISD_DATA_SAFETY_TIMER] = temp_data[35]; - pcisd->data[CISD_DATA_VSYS_OVP] = temp_data[36]; - pcisd->data[CISD_DATA_VBAT_OVP] = temp_data[37]; - pcisd->data[CISD_DATA_AFC_FAIL] = temp_data[39]; - pcisd->data[CISD_DATA_WATER_DETECT] = temp_data[38]; - } - } else { - const char *p = buf; - - pr_info("%s: %s\n", __func__, buf); - for (i = CISD_DATA_RESET_ALG; i < CISD_DATA_MAX_PER_DAY; i++) { - if (sscanf(p, "%10d%n", &pcisd->data[i], &x) > 0) - p += (size_t)x; - else { - pr_info("%s: NO DATA (cisd_data)\n", __func__); - temp_data[CISD_DATA_RESET_ALG] = -1; - break; - } + for (i = 0; i < CISD_DATA_MAX_PER_DAY; i++) + pcisd->data[i] = 0; + pcisd->data[CISD_DATA_ALG_INDEX] = battery->pdata->cisd_alg_index; + pcisd->data[CISD_DATA_FULL_COUNT] = temp_data[0]; + pcisd->data[CISD_DATA_CAP_MAX] = temp_data[1]; + pcisd->data[CISD_DATA_CAP_MIN] = temp_data[2]; + pcisd->data[CISD_DATA_VALERT_COUNT] = temp_data[16]; + pcisd->data[CISD_DATA_CYCLE] = temp_data[17]; + pcisd->data[CISD_DATA_WIRE_COUNT] = temp_data[18]; + pcisd->data[CISD_DATA_WIRELESS_COUNT] = temp_data[19]; + pcisd->data[CISD_DATA_HIGH_TEMP_SWELLING] = temp_data[20]; + pcisd->data[CISD_DATA_LOW_TEMP_SWELLING] = temp_data[21]; + pcisd->data[CISD_DATA_SWELLING_CHARGING_COUNT] = temp_data[22]; + pcisd->data[CISD_DATA_AICL_COUNT] = temp_data[26]; + pcisd->data[CISD_DATA_BATT_TEMP_MAX] = temp_data[27]; + pcisd->data[CISD_DATA_BATT_TEMP_MIN] = temp_data[28]; + pcisd->data[CISD_DATA_CHG_TEMP_MAX] = temp_data[29]; + pcisd->data[CISD_DATA_CHG_TEMP_MIN] = temp_data[30]; + pcisd->data[CISD_DATA_WPC_TEMP_MAX] = temp_data[31]; + pcisd->data[CISD_DATA_WPC_TEMP_MIN] = temp_data[32]; + pcisd->data[CISD_DATA_UNSAFETY_VOLTAGE] = temp_data[33]; + pcisd->data[CISD_DATA_UNSAFETY_TEMPERATURE] = temp_data[34]; + pcisd->data[CISD_DATA_SAFETY_TIMER] = temp_data[35]; + pcisd->data[CISD_DATA_VSYS_OVP] = temp_data[36]; + pcisd->data[CISD_DATA_VBAT_OVP] = temp_data[37]; + pcisd->data[CISD_DATA_AFC_FAIL] = temp_data[39]; + pcisd->data[CISD_DATA_WATER_DETECT] = temp_data[38]; + } + } else { + const char *p = buf; + + pr_info("%s: %s\n", __func__, buf); + for (i = CISD_DATA_RESET_ALG; i < CISD_DATA_MAX_PER_DAY; i++) { + if (sscanf(p, "%10d%n", &pcisd->data[i], &x) > 0) + p += (size_t)x; + else { + pr_info("%s: NO DATA (cisd_data)\n", __func__); + temp_data[CISD_DATA_RESET_ALG] = -1; + break; } + } - pr_info("%s: %s cisd data\n", __func__, + pr_info("%s: %s cisd data\n", __func__, ((temp_data[CISD_DATA_RESET_ALG] < 0 || battery->fg_reset) ? "init" : "update")); - if (temp_data[CISD_DATA_RESET_ALG] < 0 || battery->fg_reset) { - /* initialize data */ - for (i = CISD_DATA_RESET_ALG; i < CISD_DATA_MAX_PER_DAY; i++) - pcisd->data[i] = 0; - - battery->fg_reset = 0; - - pcisd->data[CISD_DATA_ALG_INDEX] = battery->pdata->cisd_alg_index; - - pcisd->data[CISD_DATA_FULL_COUNT] = 1; - pcisd->data[CISD_DATA_BATT_TEMP_MAX] = -300; - pcisd->data[CISD_DATA_CHG_TEMP_MAX] = -300; - pcisd->data[CISD_DATA_WPC_TEMP_MAX] = -300; - pcisd->data[CISD_DATA_USB_TEMP_MAX] = -300; - pcisd->data[CISD_DATA_BATT_TEMP_MIN] = 1000; - pcisd->data[CISD_DATA_CHG_TEMP_MIN] = 1000; - pcisd->data[CISD_DATA_WPC_TEMP_MIN] = 1000; - pcisd->data[CISD_DATA_USB_TEMP_MIN] = 1000; - pcisd->data[CISD_DATA_CAP_MIN] = 0xFFFF; - - pcisd->data[CISD_DATA_FULL_COUNT_PER_DAY] = 1; - pcisd->data[CISD_DATA_BATT_TEMP_MAX_PER_DAY] = -300; - pcisd->data[CISD_DATA_CHG_TEMP_MAX_PER_DAY] = -300; - pcisd->data[CISD_DATA_WPC_TEMP_MAX_PER_DAY] = -300; - pcisd->data[CISD_DATA_USB_TEMP_MAX_PER_DAY] = -300; - pcisd->data[CISD_DATA_BATT_TEMP_MIN_PER_DAY] = 1000; - pcisd->data[CISD_DATA_CHG_TEMP_MIN_PER_DAY] = 1000; - pcisd->data[CISD_DATA_WPC_TEMP_MIN_PER_DAY] = 1000; - pcisd->data[CISD_DATA_USB_TEMP_MIN_PER_DAY] = 1000; - - pcisd->data[CISD_DATA_CHG_BATT_TEMP_MAX] = -300; - pcisd->data[CISD_DATA_CHG_CHG_TEMP_MAX] = -300; - pcisd->data[CISD_DATA_CHG_WPC_TEMP_MAX] = -300; - pcisd->data[CISD_DATA_CHG_USB_TEMP_MAX] = -300; - pcisd->data[CISD_DATA_CHG_BATT_TEMP_MIN] = 1000; - pcisd->data[CISD_DATA_CHG_CHG_TEMP_MIN] = 1000; - pcisd->data[CISD_DATA_CHG_WPC_TEMP_MIN] = 1000; - pcisd->data[CISD_DATA_CHG_USB_TEMP_MIN] = 1000; - - pcisd->data[CISD_DATA_CHG_BATT_TEMP_MAX_PER_DAY] = -300; - pcisd->data[CISD_DATA_CHG_CHG_TEMP_MAX_PER_DAY] = -300; - pcisd->data[CISD_DATA_CHG_WPC_TEMP_MAX_PER_DAY] = -300; - pcisd->data[CISD_DATA_CHG_USB_TEMP_MAX_PER_DAY] = -300; - pcisd->data[CISD_DATA_CHG_BATT_TEMP_MIN_PER_DAY] = 1000; - pcisd->data[CISD_DATA_CHG_CHG_TEMP_MIN_PER_DAY] = 1000; - pcisd->data[CISD_DATA_CHG_WPC_TEMP_MIN_PER_DAY] = 1000; - pcisd->data[CISD_DATA_CHG_USB_TEMP_MIN_PER_DAY] = 1000; - - pcisd->data[CISD_DATA_CAP_MIN_PER_DAY] = 0xFFFF; - - - /* initialize pad data */ - init_cisd_pad_data(&battery->cisd); - } + if (temp_data[CISD_DATA_RESET_ALG] < 0 || battery->fg_reset) { + /* initialize data */ + for (i = CISD_DATA_RESET_ALG; i < CISD_DATA_MAX_PER_DAY; i++) + pcisd->data[i] = 0; + + battery->fg_reset = 0; + + pcisd->data[CISD_DATA_ALG_INDEX] = battery->pdata->cisd_alg_index; + + pcisd->data[CISD_DATA_FULL_COUNT] = 1; + pcisd->data[CISD_DATA_BATT_TEMP_MAX] = -300; + pcisd->data[CISD_DATA_CHG_TEMP_MAX] = -300; + pcisd->data[CISD_DATA_WPC_TEMP_MAX] = -300; + pcisd->data[CISD_DATA_USB_TEMP_MAX] = -300; + pcisd->data[CISD_DATA_BATT_TEMP_MIN] = 1000; + pcisd->data[CISD_DATA_CHG_TEMP_MIN] = 1000; + pcisd->data[CISD_DATA_WPC_TEMP_MIN] = 1000; + pcisd->data[CISD_DATA_USB_TEMP_MIN] = 1000; + pcisd->data[CISD_DATA_CAP_MIN] = 0xFFFF; + + pcisd->data[CISD_DATA_FULL_COUNT_PER_DAY] = 1; + pcisd->data[CISD_DATA_BATT_TEMP_MAX_PER_DAY] = -300; + pcisd->data[CISD_DATA_CHG_TEMP_MAX_PER_DAY] = -300; + pcisd->data[CISD_DATA_WPC_TEMP_MAX_PER_DAY] = -300; + pcisd->data[CISD_DATA_USB_TEMP_MAX_PER_DAY] = -300; + pcisd->data[CISD_DATA_BATT_TEMP_MIN_PER_DAY] = 1000; + pcisd->data[CISD_DATA_CHG_TEMP_MIN_PER_DAY] = 1000; + pcisd->data[CISD_DATA_WPC_TEMP_MIN_PER_DAY] = 1000; + pcisd->data[CISD_DATA_USB_TEMP_MIN_PER_DAY] = 1000; + + pcisd->data[CISD_DATA_CHG_BATT_TEMP_MAX] = -300; + pcisd->data[CISD_DATA_CHG_CHG_TEMP_MAX] = -300; + pcisd->data[CISD_DATA_CHG_WPC_TEMP_MAX] = -300; + pcisd->data[CISD_DATA_CHG_USB_TEMP_MAX] = -300; + pcisd->data[CISD_DATA_CHG_BATT_TEMP_MIN] = 1000; + pcisd->data[CISD_DATA_CHG_CHG_TEMP_MIN] = 1000; + pcisd->data[CISD_DATA_CHG_WPC_TEMP_MIN] = 1000; + pcisd->data[CISD_DATA_CHG_USB_TEMP_MIN] = 1000; + + pcisd->data[CISD_DATA_CHG_BATT_TEMP_MAX_PER_DAY] = -300; + pcisd->data[CISD_DATA_CHG_CHG_TEMP_MAX_PER_DAY] = -300; + pcisd->data[CISD_DATA_CHG_WPC_TEMP_MAX_PER_DAY] = -300; + pcisd->data[CISD_DATA_CHG_USB_TEMP_MAX_PER_DAY] = -300; + pcisd->data[CISD_DATA_CHG_BATT_TEMP_MIN_PER_DAY] = 1000; + pcisd->data[CISD_DATA_CHG_CHG_TEMP_MIN_PER_DAY] = 1000; + pcisd->data[CISD_DATA_CHG_WPC_TEMP_MIN_PER_DAY] = 1000; + pcisd->data[CISD_DATA_CHG_USB_TEMP_MIN_PER_DAY] = 1000; + + pcisd->data[CISD_DATA_CAP_MIN_PER_DAY] = 0xFFFF; + + + /* initialize pad data */ + init_cisd_pad_data(&battery->cisd); } - ret = count; - wake_lock(&battery->monitor_wake_lock); - queue_delayed_work(battery->monitor_wqueue, &battery->monitor_work, 0); } - break; + ret = count; + wake_lock(&battery->monitor_wake_lock); + queue_delayed_work(battery->monitor_wqueue, &battery->monitor_work, 0); + } + break; case CISD_DATA_JSON: { char tc; diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/flite/fimc-is-hw-flite-v4_20_0.c b/drivers/media/platform/exynos/fimc-is2/sensor/flite/fimc-is-hw-flite-v4_20_0.c index 963875df9f0f..e6822d5e38c3 100644 --- a/drivers/media/platform/exynos/fimc-is2/sensor/flite/fimc-is-hw-flite-v4_20_0.c +++ b/drivers/media/platform/exynos/fimc-is2/sensor/flite/fimc-is-hw-flite-v4_20_0.c @@ -543,4 +543,3 @@ void flite_hw_dump(u32 __iomem *base_reg) info("[0x%04X] : 0x%08X\n", FLITE_REG_WEIGHTY23, readl(base_reg + TO_WORD_OFFSET(FLITE_REG_WEIGHTY23))); } - diff --git a/drivers/media/platform/exynos/fimc-is2/sensor/flite/fimc-is-hw-flite-v4_20_0.h b/drivers/media/platform/exynos/fimc-is2/sensor/flite/fimc-is-hw-flite-v4_20_0.h index 67f02688825f..a037849f5e00 100644 --- a/drivers/media/platform/exynos/fimc-is2/sensor/flite/fimc-is-hw-flite-v4_20_0.h +++ b/drivers/media/platform/exynos/fimc-is2/sensor/flite/fimc-is-hw-flite-v4_20_0.h @@ -109,7 +109,7 @@ /* BNS */ #define FLITE_REG_BINNINGON (0x120) -#define FLITE_REG_BINNINGON_CLKGATE_ON(x) (~(x) << 1) +#define FLITE_REG_BINNINGON_CLKGATE_ON(x) (!(x) << 1) #define FLITE_REG_BINNINGON_EN(x) ((x) << 0) #define FLITE_REG_BINNINGCTRL (0x124) diff --git a/drivers/media/platform/exynos/fimc-is2/vendor/mcd/fimc-is-sysfs.c b/drivers/media/platform/exynos/fimc-is2/vendor/mcd/fimc-is-sysfs.c index 8910db40adc5..2ab3be630efb 100644 --- a/drivers/media/platform/exynos/fimc-is2/vendor/mcd/fimc-is-sysfs.c +++ b/drivers/media/platform/exynos/fimc-is2/vendor/mcd/fimc-is-sysfs.c @@ -245,7 +245,7 @@ static ssize_t camera_ssrm_camera_info_store(struct device *dev, ret_count = sscanf(buf, "%d%d%d%d%d%d%d", &temp.operation, &temp.cameraID, &temp.previewMinFPS, &temp.previewMaxFPS, &temp.previewSizeWidth, &temp.previewSizeHeight, &temp.sensorOn); - if (ret_count > sizeof(SsrmCameraInfo)/sizeof(int)) + if (ret_count > sizeof(SsrmCameraInfo)/(sizeof(int))) return -EINVAL; switch (temp.operation) { diff --git a/drivers/net/wireless/bcmdhd4361/dhd_common.c b/drivers/net/wireless/bcmdhd4361/dhd_common.c index c8cedd87c228..377c9cc98337 100644 --- a/drivers/net/wireless/bcmdhd4361/dhd_common.c +++ b/drivers/net/wireless/bcmdhd4361/dhd_common.c @@ -3836,7 +3836,7 @@ dhd_pktfilter_offload_set(dhd_pub_t * dhd, char *arg) htod16(WL_PKT_FILTER_MFLAG_NEG); (argv[i])++; } - if (argv[i] == '\0') { + if (argv[i] == NULL) { printf("Pattern not provided\n"); goto fail; } diff --git a/drivers/net/wireless/bcmdhd4361/wl_android.c b/drivers/net/wireless/bcmdhd4361/wl_android.c index 27ce4d5bf0d8..80790fb3f29c 100644 --- a/drivers/net/wireless/bcmdhd4361/wl_android.c +++ b/drivers/net/wireless/bcmdhd4361/wl_android.c @@ -7104,7 +7104,7 @@ wl_android_set_adps_mode(struct net_device *dev, const char* string_num) adps_mode = bcm_atoi(string_num); WL_ERR(("%s: SET_ADPS %d\n", __FUNCTION__, adps_mode)); - if ((adps_mode < 0) && (1 < adps_mode)) { + if ((adps_mode < 0) || (adps_mode > 1)) { WL_ERR(("%s: Invalid value %d.\n", __FUNCTION__, adps_mode)); return -EINVAL; } diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index e20909112c61..280fdf3dda46 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -7572,7 +7572,7 @@ static struct devfreq_dev_profile ufs_devfreq_profile = { static void ufs_sec_send_errinfo (void *data) { static struct ufs_hba *hba = NULL; struct SEC_UFS_counting *err_info; - char buf[16]; + char buf[17]; if (data) { hba = (struct ufs_hba *)data; diff --git a/drivers/sensorhub/brcm/ssp_i2c.c b/drivers/sensorhub/brcm/ssp_i2c.c index a05e33a107a1..b34cca468dec 100644 --- a/drivers/sensorhub/brcm/ssp_i2c.c +++ b/drivers/sensorhub/brcm/ssp_i2c.c @@ -215,7 +215,7 @@ int ssp_send_cmd(struct ssp_data *data, char command, int arg) } int send_instruction(struct ssp_data *data, u8 uInst, - u8 uSensorType, u8 *uSendBuf, u16 uLength) + u8 uSensorType, u8 *uSendBuf, u16 uLength) { char command; int iRet = 0; @@ -227,9 +227,9 @@ int send_instruction(struct ssp_data *data, u8 uInst, #endif if ((!(data->uSensorState & (1ULL << uSensorType))) - && (uInst <= CHANGE_DELAY)) { + && (uInst <= CHANGE_DELAY)) { pr_err("[SSP]: %s - Bypass Inst Skip! - %u\n", - __func__, uSensorType); + __func__, uSensorType); return FAIL; } @@ -287,7 +287,7 @@ int send_instruction(struct ssp_data *data, u8 uInst, if (msg == NULL) { iRet = -ENOMEM; pr_err("[SSP] %s, failed to alloc memory for ssp_msg\n", - __func__); + __func__); return iRet; } msg->cmd = command; @@ -311,12 +311,12 @@ int send_instruction(struct ssp_data *data, u8 uInst, if (uInst == ADD_SENSOR || uInst == CHANGE_DELAY) { unsigned int BatchTimeforReset = 0; - //current_Ts = get_current_timestamp(); + //current_Ts = get_current_timestamp(); if (uLength >= 9) BatchTimeforReset = *(unsigned int *)(&uSendBuf[4]);// Add / change normal case, not factory. - //pr_info("[SSP] %s timeForRest %d", __func__, BatchTimeforReset); - data->IsBypassMode[uSensorType] = (BatchTimeforReset == 0); - //pr_info("[SSP] sensor%d mode%d Time %lld\n", uSensorType, data->IsBypassMode[uSensorType], current_Ts); + //pr_info("[SSP] %s timeForRest %d", __func__, BatchTimeforReset); + data->IsBypassMode[uSensorType] = (BatchTimeforReset == 0); + //pr_info("[SSP] sensor%d mode%d Time %lld\n", uSensorType, data->IsBypassMode[uSensorType], current_Ts); } return iRet; } diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 88a0af7a8401..bdf76a7273d5 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -1688,41 +1688,49 @@ static ssize_t s3c24xx_serial_bt_log(struct file *file, char __user *userbuf, si static int copied_bytes = 0; if (copied_bytes >= LOG_BUFFER_SIZE) { + struct uart_port *port; port = &ourport->port; copied_bytes = 0; - if (port && port->state->pm_state == UART_PM_STATE_ON) - s3c24xx_print_reg_status(ourport); - return 0; + if (port && port->state->pm_state == UART_PM_STATE_ON) { + s3c24xx_print_reg_status(ourport); + return 0; + } + } if (copied_bytes + bytes < LOG_BUFFER_SIZE) { + ret = copy_to_user(userbuf, ourport->uart_local_buf.buffer+copied_bytes, bytes); - if(ret) - { + + if(ret) { pr_err("Failed to s3c24xx_serial_bt_log : %d\n", (int)ret); return ret; } + copied_bytes += bytes; return bytes; + } else { int byte_to_read = LOG_BUFFER_SIZE-copied_bytes; ret = copy_to_user(userbuf, ourport->uart_local_buf.buffer+copied_bytes, byte_to_read); - if(ret) - { + + if(ret) { pr_err("Failed to s3c24xx_serial_bt_log : %d\n", (int)ret); return ret; } + copied_bytes += byte_to_read; return byte_to_read; } return 0; } + static const struct file_operations proc_fops_btlog = { .owner = THIS_MODULE, .read = s3c24xx_serial_bt_log, diff --git a/drivers/usb/gadget/function/f_conn_gadget.c b/drivers/usb/gadget/function/f_conn_gadget.c index 36d2a0184712..a70b132ee74e 100644 --- a/drivers/usb/gadget/function/f_conn_gadget.c +++ b/drivers/usb/gadget/function/f_conn_gadget.c @@ -1266,8 +1266,8 @@ static void conn_gadget_cleanup(void) misc_deregister(&conn_gadget_device); - if (_conn_gadget_dev->rd_queue_buf) - vfree(_conn_gadget_dev->rd_queue_buf); + if (_conn_gadget_dev->rd_queue_buf) + vfree(_conn_gadget_dev->rd_queue_buf); kfree(_conn_gadget_dev); _conn_gadget_dev = NULL; diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 0705d8883ede..203292f0cd01 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -35,7 +35,6 @@ #include - /* * Frame buffer device initialization and setup routines */ diff --git a/fs/ecryptfs/ecryptfs_dek.c b/fs/ecryptfs/ecryptfs_dek.c index 7cda09b0bf53..5c0c64bd6cbb 100644 --- a/fs/ecryptfs/ecryptfs_dek.c +++ b/fs/ecryptfs/ecryptfs_dek.c @@ -361,15 +361,15 @@ static int ecryptfs_update_crypt_flag(struct dentry *dentry, enum sdp_op operati inode = dentry->d_inode; lower_inode = ecryptfs_inode_to_lower(inode); - /* - * To update metadata we need to make sure keysig_list contains fekek. - * Because our EDEK is stored along with key for protected file. - */ - if(list_empty(&crypt_stat->keysig_list)) - ecryptfs_dek_copy_mount_wide_sigs_to_inode_sigs(crypt_stat, mount_crypt_stat); - + /* + * To update metadata we need to make sure keysig_list contains fekek. + * Because our EDEK is stored along with key for protected file. + */ + if(list_empty(&crypt_stat->keysig_list)) + ecryptfs_dek_copy_mount_wide_sigs_to_inode_sigs(crypt_stat, mount_crypt_stat); mutex_lock(&crypt_stat->cs_mutex); rc = ecryptfs_get_lower_file(dentry, inode); + if (rc) { mutex_unlock(&crypt_stat->cs_mutex); DEK_LOGE("ecryptfs_get_lower_file rc=%d\n", rc); @@ -381,16 +381,16 @@ static int ecryptfs_update_crypt_flag(struct dentry *dentry, enum sdp_op operati crypt_stat->flags |= ECRYPTFS_DEK_IS_SENSITIVE; crypt_stat->flags |= ECRYPTFS_DEK_MULTI_ENGINE; /* - * Set sensitive to inode mapping - */ + * Set sensitive to inode mapping + */ ecryptfs_set_mapping_sensitive(inode, mount_crypt_stat->userid, TO_SENSITIVE); } else { crypt_stat->flags &= ~ECRYPTFS_DEK_IS_SENSITIVE; - crypt_stat->flags &= ~ECRYPTFS_DEK_MULTI_ENGINE; + crypt_stat->flags &= ~ECRYPTFS_DEK_MULTI_ENGINE; /* - * Set protected to inode mapping - */ + * Set protected to inode mapping + */ ecryptfs_set_mapping_sensitive(inode, mount_crypt_stat->userid, TO_PROTECTED); } @@ -409,7 +409,7 @@ static int ecryptfs_update_crypt_flag(struct dentry *dentry, enum sdp_op operati goto out; } -out: + out: mutex_unlock(&crypt_stat->cs_mutex); ecryptfs_put_lower_file(inode); fsstack_copy_attr_all(inode, lower_inode); diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8a1f6293176a..1dad9586d55b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9920,9 +9920,9 @@ static int move_specific_task(struct lb_env *env, struct task_struct *pm) struct task_struct *p, *n; list_for_each_entry_safe(p, n, &env->src_rq->cfs_tasks, se.group_node) { - if (throttled_lb_pair(task_group(p), env->src_rq->cpu, + if (throttled_lb_pair(task_group(p), env->src_rq->cpu, env->dst_cpu)) - continue; + continue; if (!hmp_can_migrate_task(p, env)) continue; diff --git a/net/core/sock.c b/net/core/sock.c index beb2d98f87cf..85a5b76ef481 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -749,7 +749,7 @@ EXPORT_SYMBOL(sk_mc_loop); */ int sock_setsockopt(struct socket *sock, int level, int optname, - char __user *optval, unsigned int optlen) + char __user *optval, unsigned int optlen) { struct sock *sk = sock->sk; int val; @@ -764,12 +764,12 @@ int sock_setsockopt(struct socket *sock, int level, int optname, if (optname == SO_BINDTODEVICE) return sock_setbindtodevice(sk, optval, optlen); - /* START_OF_KNOX_NPA */ - if (optname == SO_SET_DOMAIN_NAME) - return sock_set_domain_name(sk, optval, optlen); - if (optname == SO_SET_DNS_UID) - return sock_set_dns_uid(sk, optval, optlen); - /* END_OF_KNOX_NPA */ + /* START_OF_KNOX_NPA */ + if (optname == SO_SET_DOMAIN_NAME) + return sock_set_domain_name(sk, optval, optlen); + if (optname == SO_SET_DNS_UID) + return sock_set_dns_uid(sk, optval, optlen); + /* END_OF_KNOX_NPA */ if (optlen < sizeof(int)) return -EINVAL; @@ -813,7 +813,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname, * are treated in BSD as hints */ val = min_t(u32, val, sysctl_wmem_max); -set_sndbuf: + set_sndbuf: sk->sk_userlocks |= SOCK_SNDBUF_LOCK; sk->sk_sndbuf = max_t(int, val * 2, SOCK_MIN_SNDBUF); /* Wake up sending tasks if we upped the value. */ @@ -834,7 +834,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname, * are treated in BSD as hints */ val = min_t(u32, val, sysctl_rmem_max); -set_rcvbuf: + set_rcvbuf: sk->sk_userlocks |= SOCK_RCVBUF_LOCK; /* * We double it on the way in to account for @@ -864,7 +864,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname, case SO_KEEPALIVE: #ifdef CONFIG_INET if (sk->sk_protocol == IPPROTO_TCP && - sk->sk_type == SOCK_STREAM) + sk->sk_type == SOCK_STREAM) tcp_set_keepalive(sk, valbool); #endif sock_valbool_flag(sk, SOCK_KEEPOPEN, valbool); @@ -880,7 +880,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname, case SO_PRIORITY: if ((val >= 0 && val <= 6) || - ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN)) + ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN)) sk->sk_priority = val; else ret = -EPERM; @@ -941,9 +941,9 @@ int sock_setsockopt(struct socket *sock, int level, int optname, } if (val & SOF_TIMESTAMPING_OPT_ID && - !(sk->sk_tsflags & SOF_TIMESTAMPING_OPT_ID)) { + !(sk->sk_tsflags & SOF_TIMESTAMPING_OPT_ID)) { if (sk->sk_protocol == IPPROTO_TCP && - sk->sk_type == SOCK_STREAM) { + sk->sk_type == SOCK_STREAM) { if (sk->sk_state != TCP_ESTABLISHED) { ret = -EINVAL; break; @@ -956,10 +956,10 @@ int sock_setsockopt(struct socket *sock, int level, int optname, sk->sk_tsflags = val; if (val & SOF_TIMESTAMPING_RX_SOFTWARE) sock_enable_timestamp(sk, - SOCK_TIMESTAMPING_RX_SOFTWARE); + SOCK_TIMESTAMPING_RX_SOFTWARE); else sock_disable_timestamp(sk, - (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE)); + (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE)); break; case SO_RCVLOWAT: @@ -1066,7 +1066,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname, case SO_MAX_PACING_RATE: sk->sk_max_pacing_rate = val; sk->sk_pacing_rate = min(sk->sk_pacing_rate, - sk->sk_max_pacing_rate); + sk->sk_max_pacing_rate); break; case SO_INCOMING_CPU: