Re: [PATCH v2 3/7] USB: serial: ftdi_sio: Extract SIO divisor code to function

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

 



On Tue, Sep 13, 2022 at 05:30:51PM +0200, Pali Rohár wrote:
> On Tuesday 13 September 2022 16:49:01 Johan Hovold wrote:
> > > > > @@ -1286,7 +1303,7 @@ static u32 get_ftdi_divisor(struct tty_struct *tty,
> > > > >  {
> > > > >  	struct ftdi_private *priv = usb_get_serial_port_data(port);
> > > > >  	struct device *dev = &port->dev;
> > > > > -	u32 div_value = 0;
> > > > > +	int div_value = 0;
> > > > 
> > > > And don't change the type here.
> > > 
> > > This type change was explicitly asked during v1 review. v1 had u32.
> > 
> > Ok, but don't. This variable is used in other parts of this function.
> 
> As I said, I changed it just because I was explicitly asked for it
> during v1 review. I'm just doing what I was asked.
> 
> Maybe... I can change it into union?
> 
>   union {
>     s32 signed;
>     u32 unsigned;
>   } div_value;
> 
> I really do not see any other option how to achieve requirement that it
> should be type of "int" with your another requirement that "do not do it".

I'm pretty sure I didn't review v1.

Perhaps you're referring to this:

	https://lore.kernel.org/all/Ysb3ORyUAPEOntqK@xxxxxxxxx/

But that doesn't mean you should change the type of div_value.

Johan



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux