Re: [uclinux-dist-devel] [PATCH] USB: musb: blackfin: work around anomaly 05000450

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

 



Hello.

On 29-03-2011 20:33, Mike Frysinger wrote:

+static int bfin_musb_channel_program(struct dma_channel *channel,
+                               u16 *packet_sz, u8 *mode,

   Are you going to change 'packet_sz'? That's interesting... :-)

i dont need to, i was just making everything an option because i
assume i cant foresee everyone's requirement.  if changing packet_sz
doesnt make sense, i can drop the pointer.

   I don't think it makes much sense indeed.

+               if (musb_channel->transmit&&  *mode == 1)
+                       *len = *len - (*len % *packet_sz);

   Parens not needed. And why not:

        *len -= *len % *packet_sz;

We're coding in C, after all. :-)

yes, but rather than force people to remember the more obscure
operator precedence,  just about anyone can look at my version and
instantly digest what it's doing.

Hm? All precedences seems quite natural here -- "mod" has priority over minus in math.

+       int     (*channel_program)(struct dma_channel *channel,
+                               u16 *packet_sz, u8 *mode,
+                               dma_addr_t *dma_addr, u32 *len);

   Sigh. I don't think channel_program is a good name -- the function doesn't
actually program anything.

i was just trying to make it obvious that this correlates directly to
the existing channel_program func.  i could call it
"pre_channel_program" or something else ... i dont particularly care.

   That sounds better indeed.

suggest a better name :P.

   It seems quite hard indeed. :-)
   Perhaps adjust_dma_params() or something.

-mike

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux