Re: [PATCH v2 04/14] hwmon: (ina2xx) Mark regmap_config as const

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 29, 2024 at 06:05:44PM -0700, Guenter Roeck wrote:
> Recent versions of checkpatch complain that struct regmap_config
> should be declared as const.
> 
> WARNING: struct regmap_config should normally be const
> 
> Doing so reveals a potential problem in the driver: If both supported
> chips are present in a single system, the maximum number of registers
> may race when devices are instantiated since max_registers is updated
> in the probe function. Solve the problem by setting .max_registers to the
> maximum register address of all supported chips. This does not make a
> practical difference while fixing the potential race condition and reducing
> code complexity.
> 
> Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>

Reviewed-by: Tzung-Bi Shih <tzungbi@xxxxxxxxxx>




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux