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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 09 Apr 2015 17:50:52 +0200
From:	Pelle Nilsson <per.nilsson@...mo.com>
To:	Mark Brown <broonie@...nel.org>
CC:	linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org,
	nios2-dev@...ts.rocketboards.org
Subject: Re: [PATCH 1/1] spi: altera: Add empty implementation of setup_transfer
 callback

On 2015-04-09 17:40, Mark Brown wrote:
> Why is the callback mandatory if an empty implementation is OK?

Ask the author of spi-bitbang. :-)

In spi_bitbang_start() we have this chunk of code:

	if (!bitbang->txrx_bufs) {
		bitbang->use_dma = 0;
		bitbang->txrx_bufs = spi_bitbang_bufs;
		if (!master->setup) {
			if (!bitbang->setup_transfer)
				bitbang->setup_transfer =
					 spi_bitbang_setup_transfer;
			master->setup = spi_bitbang_setup;
			master->cleanup = spi_bitbang_cleanup;
		}
	}

As can be seen here, if setup_transfer is NULL (not set by the
specific driver), it is filled in with the default callback function
spi_bitbang_setup_transfer(), but only if txrx_bufs is also NULL,
which is not the case here.

There is a comment in spi-xilinx also stating this fact (though their
implementation isn't actually empty anymore):

/* spi_bitbang requires custom setup_transfer() to be defined if there
is a
 * custom txrx_bufs().
 */
--
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