lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d120d5000709100811r520a7eeew7977739e08da85f9@mail.gmail.com>
Date:	Mon, 10 Sep 2007 11:11:14 -0400
From:	"Dmitry Torokhov" <dmitry.torokhov@...il.com>
To:	"Dmitry Torokhov" <dtor@...ightbb.com>
Cc:	"Arjan van de Ven" <arjan@...radead.org>,
	"Paul Mundt" <lethal@...ux-sh.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] Maple bus support for the Sega Dreamcast - keyboard support

On 9/10/07, Adrian McMenamin <dmitry.torokhov@...il.com> wrote:
> On 10/09/2007, Dmitry Torokhov <dtor@...ightbb.com> wrote:
> > Hi Adrian,
> >
>
> Thanks for the comments - will get on with this but....
>
>
> > > +     for (i = 0; i < NR_SCANCODES; i++)
> > > +             kbd->keycode[i] = dc_kbd_keycode[i];
> >
> > memcpy?
> >
>
> I see that other drivers use memcpy - and will happily convert over -
> but, out of interest, is there a reasopn why it is superior?
>

First and foremost it conveys the intent clearly - you are copying a
chunk of memory (namely a keymap) from one place to another - thus
memcpy. Plus it may produce smaller/faster code (but since it is not a
hot path this does not matter much).

> >
> > maple_device appears to be fully integrated in sysfs, please add:
> >        kbd->dev->dev.parent = &dev->dev;
> >
>
> The bus code already correctly ids the parent device (the above code
> would appear to assign the device as the device's parent
> incidentally). Is it wrong to make that assignment in the central bus
> code as opposed to the driver?
>

Here I want to set up sysfs relation for the newly created struct
input_dev which is a child of struct maple_dev. The central bus
(maple) code has no idea of input device existence, hasn't it? IOW we
need:

     input_dev->dev.parent = &maple_dev->dev;

-- 
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ