Skip to content
  • Lee Jones's avatar
    mfd: ab8500-gpadc: Squash a whole bunch of Checkpatch warnings and one error · df36442c
    Lee Jones authored
    
    
    WARNING: line over 80 characters
    +#define ADC_CH_IBAT_MIN                        (-6000) /* mA range measured by ADC for ib
    t*/
    
    WARNING: line over 80 characters
    +#define ADC_CH_IBAT_MIN_V              (-60)   /* mV range measured by ADC for ibat*/
    
    WARNING: suspect code indent for conditional statements (16, 20)
    +               if (!strcmp(name, dev_name(gpadc->dev)))
    +                   return gpadc;
    
    WARNING: suspect code indent for conditional statements (0, 16)
    +if (ad_value < 0) {
    +               dev_err(gpadc->dev, "GPADC raw value failed ch: %d\n",
    
    WARNING: quoted string split across lines
    +               dev_err(gpadc->dev, "GPADC to voltage conversion failed ch:"
    +                       " %d AD: 0x%x\n", channel, ad_value);
    
    WARNING: Missing a blank line after declarations
    +       int raw_data;
    +       raw_data = ab8500_gpadc_double_read_raw(gpadc, channel,
    
    WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
    +               msleep(10);
    
    ERROR: else should follow close brace '}'
    +       }
    +       else
    
    WARNING: line over 80 characters
    +                       delay_max = 10000; /* large range to optimise sleep mode */
    
    WARNING: line over 80 characters
    +                       gpadc->cal_data[ADC_INPUT_IBAT].gain = V_gain * V2A_gain;
    
    WARNING: line over 80 characters
    +       gpadc = devm_kzalloc(&pdev->dev, sizeof(struct ab8500_gpadc), GFP_KERNEL);
    
    WARNING: Possible unnecessary 'out of memory' message
    +       if (!gpadc) {
    +               dev_err(&pdev->dev, "Error: No memory\n");
    
    WARNING: space prohibited before semicolon
    +       return ;
    
    WARNING: void function return statements are not generally useful
    +       return ;
    +}
    
    WARNING: quoted string split across lines
    +MODULE_AUTHOR("Arun R Murthy, Daniel Willerud, Johan Palsson,"
    +               "M'boumba Cedric Madianga");
    
    total: 1 errors, 14 warnings, 1089 lines checked
    
    Cc: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
    df36442c