Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

universal8895: Fix warnings/errors on R #4

Open
wants to merge 1 commit into
base: lineage-17.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)

Expand Down
210 changes: 105 additions & 105 deletions drivers/battery_v2/sec_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}


Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/bcmdhd4361/dhd_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/bcmdhd4361/wl_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/ufs/ufshcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 8 additions & 8 deletions drivers/sensorhub/brcm/ssp_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down
Loading