linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] spi: Add file i/o to spidev_test
       [not found] ` <20151117153746.GS31303@sirena.org.uk>
@ 2015-11-17 16:15   ` Joshua Clayton
  2015-11-17 16:53     ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Joshua Clayton @ 2015-11-17 16:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday, November 17, 2015 03:37:46 PM Mark Brown wrote:
> On Tue, Nov 17, 2015 at 07:24:20AM -0800, Joshua Clayton wrote:
> 
> >   Documentation/spi/spidev_test.c: use one rx buffer
> >   Documentation/spi/spidev_test.c: clean up input_tx
> >   Documentation/spi/spidev_test.c: accept input from a file
> >   Documentation/spi/spidev_test.c: output to a file
> >   Documentation/spi/spidev_test.c: check error
> >   Documentation/spi/spidev_test.c: fix whitespace
> 
> Please use subjct lines reflecting the style for the subsystem.
OK. Will do.
Assuming "spi: spidev_test: yadda..." 
It was a bit unclear due to the location of the file.

-- 
~Joshua Clayton

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 0/8] spi: Add file i/o to spidev_test
  2015-11-17 16:15   ` [PATCH 0/8] spi: Add file i/o to spidev_test Joshua Clayton
@ 2015-11-17 16:53     ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2015-11-17 16:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 17, 2015 at 08:15:45AM -0800, Joshua Clayton wrote:
> On Tuesday, November 17, 2015 03:37:46 PM Mark Brown wrote:
> > On Tue, Nov 17, 2015 at 07:24:20AM -0800, Joshua Clayton wrote:

> > >   Documentation/spi/spidev_test.c: use one rx buffer
> > >   Documentation/spi/spidev_test.c: clean up input_tx
> > >   Documentation/spi/spidev_test.c: accept input from a file
> > >   Documentation/spi/spidev_test.c: output to a file
> > >   Documentation/spi/spidev_test.c: check error
> > >   Documentation/spi/spidev_test.c: fix whitespace

> > Please use subjct lines reflecting the style for the subsystem.

> OK. Will do.
> Assuming "spi: spidev_test: yadda..." 

Something like that.

> It was a bit unclear due to the location of the file.

It's not really the location that you should be focusing on, it's other
commits in the file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151117/a48258ac/attachment.sig>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/8] Documentation/spi/spidev_test.c: use one rx buffer
       [not found]   ` <20151117174156.GX31303@sirena.org.uk>
@ 2015-11-17 18:58     ` Joshua Clayton
  0 siblings, 0 replies; 7+ messages in thread
From: Joshua Clayton @ 2015-11-17 18:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday, November 17, 2015 05:41:56 PM Mark Brown wrote:
> On Tue, Nov 17, 2015 at 07:24:21AM -0800, Joshua Clayton wrote:
> 
> > default_rx and rx are needlessly different.
> > Use one buffer, local to transmit()
> 
> Why?  This isn't what I'd expect from black boxing the API, from a
> userspace point of view the transfer is atomic and in an ideal world
> we'd be able to do direct to/from memory transfers rather than memcpy()
> into kernel space which means that userspace should assume the transfers
> are going on simultaneously even if they don't currently.

The important thing here was to get rid of the default_rx buffer.
I just noticed that the output can be set up completely within the scope
of the transmit function, since the operands are global. But I would be
just as happy to set it up at the top level. I'll change this in V2

--
~Joshua Clayton

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/8] Documentation/spi/spidev_test.c: clean up input_tx
       [not found]   ` <20151117174333.GY31303@sirena.org.uk>
@ 2015-11-17 19:21     ` Joshua Clayton
  2015-11-17 22:52       ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Joshua Clayton @ 2015-11-17 19:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday, November 17, 2015 05:43:33 PM Mark Brown wrote:
> On Tue, Nov 17, 2015 at 07:24:22AM -0800, Joshua Clayton wrote:
> > Put input from string into its own function.
> 
> Again, why are we doing this?  I'm having a hard time seeing what the
> gain is, the amount of code being moved is tiny.

It takes some clutter out of main() whose scope is limited to that little block of code, 
and because in the next patch we add another (larger)function to the if/else block.

I don't know if it is valid to say "look at the next commit" for justification, but
That is the reason.

-- 
~Joshua Clayton

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 3/8] Documentation/spi/spidev_test.c: accept input from a file
       [not found]   ` <564B716E.5020605@gmail.com>
@ 2015-11-17 19:28     ` Joshua Clayton
  0 siblings, 0 replies; 7+ messages in thread
From: Joshua Clayton @ 2015-11-17 19:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday, November 17, 2015 07:26:54 PM Anton Bondarenko wrote:
> On 17.11.2015 16:24, Joshua Clayton wrote:
> > +	if (sb.st_size > 4096)
> > +		pabort("input file exceeds spidev's 4k limit");
> This is not a true. IIRC PAGE_SIZE is the default buffer size for 
> spidev, but can be changed using bufsiz module parameter.
> Just 'insmod spidev bufsiz=X', where X is number of bytes.

You are right. I will drop this. As Mark suggests.
The ioctl gives a nice error code if the buffer is too big.

...
> > +	tx = malloc(sb.st_size);
> It would be good to check new allocations for fail.

I will add a check for this. 

-- 
~Joshua Clayton

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 7/8] tools/Makefile: minor whitespace cleanup
       [not found]   ` <20151117180924.GZ31303@sirena.org.uk>
@ 2015-11-17 19:41     ` Joshua Clayton
  0 siblings, 0 replies; 7+ messages in thread
From: Joshua Clayton @ 2015-11-17 19:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday, November 17, 2015 06:09:24 PM Mark Brown wrote:
> On Tue, Nov 17, 2015 at 07:24:27AM -0800, Joshua Clayton wrote:
> > Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
> > ---
> >  tools/Makefile | 37 ++++++++++++++++++++++++++++++-------
> >  1 file changed, 30 insertions(+), 7 deletions(-)
> > 
> > diff --git a/tools/Makefile b/tools/Makefile
> > index 9a617ad..428fb4d 100644
> > --- a/tools/Makefile
> > +++ b/tools/Makefile
> > @@ -80,10 +80,21 @@ turbostat_install x86_energy_perf_policy_install:
> >  tmon_install:
> >  	$(call descend,thermal/$(@:_install=),install)
> >  
> > -install: acpi_install cgroup_install cpupower_install hv_install firewire_install lguest_install \
> > -		perf_install selftests_install turbostat_install usb_install \
> > -		virtio_install vm_install net_install x86_energy_perf_policy_install \
> > -	tmon
> > +install: acpi_install \
> > +		cgroup_install \
> > +		cpupower_install \
> > +		hv_install \
> > +		firewire_install \
> > +		lguest_install \
> > +		perf_install \
> > +		selftests_install \
> > +		tmon \
> > +		turbostat_install \
> > +		usb_install \
> > +		virtio_install \
> > +		vm_install \
> > +		net_install \
> > +		x86_energy_perf_policy_install
> 
> This isn't a whitespace cleanup, this is a substantial reindentation of
> the file :(  Please ensure your changelogs are accurate and in general
> try to avoid mixing this sort of invasive stylistic change in with other
> patch serieses, it reduces the potential for conflicts.
Um.
Inability to resist Makefile cleanup is a weakness of mine. 
It is a tangent from the rest of the series so I'll drop it.

-- 
~Joshua Clayton

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/8] Documentation/spi/spidev_test.c: clean up input_tx
  2015-11-17 19:21     ` [PATCH 2/8] Documentation/spi/spidev_test.c: clean up input_tx Joshua Clayton
@ 2015-11-17 22:52       ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2015-11-17 22:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 17, 2015 at 11:21:12AM -0800, Joshua Clayton wrote:

Please fix your mail client to word wrap within paragraphs at something
substantially less than 80 columns.  Doing this makes your messages much
easier to read and reply to.

> It takes some clutter out of main() whose scope is limited to that little block of code, 
> and because in the next patch we add another (larger)function to the if/else block.

> I don't know if it is valid to say "look at the next commit" for justification, but
> That is the reason.

That's totally fine - just say that it's to support future changes in
this area.  It's good to split out mechanical changes like this from the
more complex changes, you just need to say why they're happening.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151117/0a2f7f03/attachment.sig>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-11-17 22:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1447773299.git.stillcompiling@gmail.com>
     [not found] ` <20151117153746.GS31303@sirena.org.uk>
2015-11-17 16:15   ` [PATCH 0/8] spi: Add file i/o to spidev_test Joshua Clayton
2015-11-17 16:53     ` Mark Brown
     [not found] ` <2f17ae29e75967b4522b080c275b907622e1d353.1447773299.git.stillcompiling@gmail.com>
     [not found]   ` <20151117174156.GX31303@sirena.org.uk>
2015-11-17 18:58     ` [PATCH 1/8] Documentation/spi/spidev_test.c: use one rx buffer Joshua Clayton
     [not found] ` <7f2139b27013d77993c6bc2b0a6c94fab01add98.1447773299.git.stillcompiling@gmail.com>
     [not found]   ` <20151117174333.GY31303@sirena.org.uk>
2015-11-17 19:21     ` [PATCH 2/8] Documentation/spi/spidev_test.c: clean up input_tx Joshua Clayton
2015-11-17 22:52       ` Mark Brown
     [not found] ` <d90d749776cf562bc9922aff5e97cb911a77b22b.1447773299.git.stillcompiling@gmail.com>
     [not found]   ` <564B716E.5020605@gmail.com>
2015-11-17 19:28     ` [PATCH 3/8] Documentation/spi/spidev_test.c: accept input from a file Joshua Clayton
     [not found] ` <155366ac799345f42c8c342609ffa11b2df529b0.1447773299.git.stillcompiling@gmail.com>
     [not found]   ` <20151117180924.GZ31303@sirena.org.uk>
2015-11-17 19:41     ` [PATCH 7/8] tools/Makefile: minor whitespace cleanup Joshua Clayton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).