From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geert Uytterhoeven Subject: Re: [PATCH 4/5] spi: spi-gpio: Make optional chipselect handling more explicit Date: Wed, 3 Jan 2018 10:17:17 +0100 Message-ID: References: <20180101133749.29567-1-linus.walleij@linaro.org> <20180101133749.29567-5-linus.walleij@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Mark Brown , linux-spi To: Linus Walleij Return-path: In-Reply-To: Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Hi Linus, On Wed, Jan 3, 2018 at 9:58 AM, Linus Walleij wrote: > On Wed, Jan 3, 2018 at 9:21 AM, Geert Uytterhoeven wrote: > >> Hmm, having two indicators for the same feature (spi_gpio->has_cs == true and >> spi_gpio->cs_gpios[0] = NULL), and the need to keep them in sync in the >> future, also complicates things. > > The patch does not do this. > > It removes the latter and adds the former. That is why it removes the > assignment of NULL to cs_gpios[0]. So what is cs_gpios[0] if has_cs == true? Oh, it will point to unallocated memory right after the structure... See, that's the ambiguity of having two variables... We do have NULL pointers and ERR_PTRs, so this ambiguity can (and IMHO should) be avoided. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html