Re: [PATCH v1 1/3] hwmon: (emc2305) add support for EMC2301/2/3/5 RPM-based PWM Fan Speed Controller.

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

 



On Tue, May 24, 2022 at 04:17:01PM +0000, Michael Shych wrote:
> 
> > > +static umode_t
> > > +emc2305_is_visible(const void *data, enum hwmon_sensor_types type,
> > > +u32 attr, int channel) {
> > > +	int max_channel = emc2305_get_max_channel((struct emc2305_data
> > > +*)data);
> > 
> > Unnecessary typecast.
> It's required as otherwise there is compilation warning.
> 

Arguable. The critical part is the change from a const pointer
to a non-const pointer, which is in general not a good idea.
It doesn't matter here, but it would be better to declare
the parameter of emc2305_get_max_channel to be a const *.

Guenter



[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